"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/h323caps.cxx" between
h323plus-1_27_0.tar.gz and h323plus-1_27_1.tar.gz

About: H.323 Plus offers libraries for voice (VoIP) and videoconferencing using H.323.

h323caps.cxx  (h323plus-1_27_0):h323caps.cxx  (h323plus-1_27_1)
skipping to change at line 38 skipping to change at line 38
* *
* $Id$ * $Id$
* *
*/ */
#ifdef __GNUC__ #ifdef __GNUC__
#pragma implementation "h323caps.h" #pragma implementation "h323caps.h"
#endif #endif
#include <ptlib.h> #include <ptlib.h>
#include <ptclib/random.h>
#include "h323caps.h" #include "h323caps.h"
#include "h323ep.h" #include "h323ep.h"
#include "h323pdu.h" #include "h323pdu.h"
#include "h323neg.h" #include "h323neg.h"
#include "codec/opalplugin.h" #include "codec/opalplugin.h"
#include "mediafmt.h" #include "mediafmt.h"
#include <algorithm> #include <algorithm>
skipping to change at line 1648 skipping to change at line 1649
return extCapabilities; return extCapabilities;
} }
//////////////////////////////////////////////////////////////////////////////// /////////////////// //////////////////////////////////////////////////////////////////////////////// ///////////////////
// H.239 Control // H.239 Control
// These H.245 functions need to be spun off into a common utilities class // These H.245 functions need to be spun off into a common utilities class
H245_GenericParameter & buildGenericInteger(H245_GenericParameter & param, unsig ned id, unsigned val) H245_GenericParameter & buildGenericInteger(H245_GenericParameter & param, unsig ned id, unsigned val)
{ {
H245_ParameterIdentifier & idm = param.m_parameterIdentifier; H245_ParameterIdentifier & idm = param.m_parameterIdentifier;
idm.SetTag(H245_ParameterIdentifier::e_standard); idm.SetTag(H245_ParameterIdentifier::e_standard);
PASN_Integer & idx = idm; PASN_Integer & idx = idm;
idx = id; idx = id;
H245_ParameterValue & genvalue = param.m_parameterValue; H245_ParameterValue & genvalue = param.m_parameterValue;
genvalue.SetTag(H245_ParameterValue::e_unsignedMin); genvalue.SetTag(H245_ParameterValue::e_unsignedMin);
PASN_Integer & xval = genvalue; PASN_Integer & xval = genvalue;
xval = val; xval = val;
return param; return param;
} }
H245_GenericParameter & buildGenericLogical(H245_GenericParameter & param, unsig ned id) H245_GenericParameter & buildGenericLogical(H245_GenericParameter & param, unsig ned id)
{ {
H245_ParameterIdentifier & paramId = param.m_parameterIdentifier; H245_ParameterIdentifier & paramId = param.m_parameterIdentifier;
paramId.SetTag(H245_ParameterIdentifier::e_standard); paramId.SetTag(H245_ParameterIdentifier::e_standard);
PASN_Integer & idx = paramId; PASN_Integer & idx = paramId;
idx = id; idx = id;
H245_ParameterValue & val = param.m_parameterValue; H245_ParameterValue & val = param.m_parameterValue;
val.SetTag(H245_ParameterValue::e_logical); val.SetTag(H245_ParameterValue::e_logical);
return param; return param;
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void BuildH239GenericMessageIndication(H239Control & ctrl, H323Connection & conn ection, H323ControlPDU& pdu, H239Control::H239SubMessages submesId) void BuildH239GenericMessageIndication(H239Control & ctrl, H323Connection & conn ection, H323ControlPDU & pdu, H239Control::H239SubMessages submesId)
{ {
PTRACE(4,"H239\tSending Generic Message Indication."); PTRACE(4, "H239\tSending Generic Message Indication.");
H245_GenericMessage & cap = pdu.Build(H245_IndicationMessage::e_genericIndic ation); H245_GenericMessage & cap = pdu.Build(H245_IndicationMessage::e_genericIndic ation);
H245_CapabilityIdentifier & id = cap.m_messageIdentifier; H245_CapabilityIdentifier & id = cap.m_messageIdentifier;
id.SetTag(H245_CapabilityIdentifier::e_standard); id.SetTag(H245_CapabilityIdentifier::e_standard);
PASN_ObjectId & gid = id; PASN_ObjectId & gid = id;
gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage); gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage);
cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier); cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier);
PASN_Integer & subMesID = cap.m_subMessageIdentifier; PASN_Integer & subMesID = cap.m_subMessageIdentifier;
subMesID = submesId; subMesID = submesId;
cap.IncludeOptionalField(H245_GenericMessage::e_messageContent); cap.IncludeOptionalField(H245_GenericMessage::e_messageContent);
H245_ArrayOf_GenericParameter & msg = cap.m_messageContent; H245_ArrayOf_GenericParameter & msg = cap.m_messageContent;
msg.SetSize(2); msg.SetSize(2);
buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0); buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0);
buildGenericInteger(msg[1], H239Control::h239gpChannelId, connection.GetLogi calChannels()->GetLastChannelNumber()); buildGenericInteger(msg[1], H239Control::h239gpChannelId, ctrl.GetRequestedC hanNum());
} }
void BuildH239GenericMessageResponse(H239Control & ctrl, H323Connection & connec tion, void BuildH239GenericMessageResponse(H239Control & ctrl, H323Connection & connec tion,
H323ControlPDU& pdu, H239Control::H239SubMe ssages submesId, H323ControlPDU & pdu, H239Control::H239SubM essages submesId,
PBoolean approved) PBoolean approved)
{ {
H245_GenericMessage & cap = pdu.Build(H245_ResponseMessage::e_genericRespons e); H245_GenericMessage & cap = pdu.Build(H245_ResponseMessage::e_genericRespons e);
H245_CapabilityIdentifier & id = cap.m_messageIdentifier; H245_CapabilityIdentifier & id = cap.m_messageIdentifier;
id.SetTag(H245_CapabilityIdentifier::e_standard); id.SetTag(H245_CapabilityIdentifier::e_standard);
PASN_ObjectId & gid = id; PASN_ObjectId & gid = id;
gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage); gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage);
cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier); cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier);
skipping to change at line 1725 skipping to change at line 1726
msg.SetSize(1); msg.SetSize(1);
buildGenericLogical(msg[0], H239Control::h239gpReject); buildGenericLogical(msg[0], H239Control::h239gpReject);
} else { } else {
msg.SetSize(3); msg.SetSize(3);
buildGenericLogical(msg[0], H239Control::h239gpAcknowledge); buildGenericLogical(msg[0], H239Control::h239gpAcknowledge);
buildGenericInteger(msg[1], H239Control::h239gpTerminalLabel, 0); buildGenericInteger(msg[1], H239Control::h239gpTerminalLabel, 0);
buildGenericInteger(msg[2], H239Control::h239gpChannelId, ctrl.GetChannelNum (H323Capability::e_Receive)); buildGenericInteger(msg[2], H239Control::h239gpChannelId, ctrl.GetChannelNum (H323Capability::e_Receive));
} }
} }
void BuildH239GenericMessageRequest(H239Control & ctrl, H323Connection & connect ion, H323ControlPDU& pdu, H239Control::H239SubMessages submesId) void BuildH239GenericMessageRequest(H239Control & ctrl, H323Connection & connect ion, H323ControlPDU & pdu, H239Control::H239SubMessages submesId)
{ {
H245_GenericMessage & cap = pdu.Build(H245_RequestMessage::e_genericRequest) ; H245_GenericMessage & cap = pdu.Build(H245_RequestMessage::e_genericRequest) ;
H245_CapabilityIdentifier & id = cap.m_messageIdentifier; H245_CapabilityIdentifier & id = cap.m_messageIdentifier;
id.SetTag(H245_CapabilityIdentifier::e_standard); id.SetTag(H245_CapabilityIdentifier::e_standard);
PASN_ObjectId & gid = id; PASN_ObjectId & gid = id;
gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage); gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage);
cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier); cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier);
PASN_Integer & subMesID = cap.m_subMessageIdentifier; PASN_Integer & subMesID = cap.m_subMessageIdentifier;
subMesID = submesId; subMesID = submesId;
cap.IncludeOptionalField(H245_GenericMessage::e_messageContent); cap.IncludeOptionalField(H245_GenericMessage::e_messageContent);
H245_ArrayOf_GenericParameter & msg = cap.m_messageContent; H245_ArrayOf_GenericParameter & msg = cap.m_messageContent;
msg.SetSize(3); msg.SetSize(3);
buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0); buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0);
int channelID = connection.GetLogicalChannels()->GetLastChannelNumber()+1; int channelID = 0;
if (submesId == H239Control::e_presentationTokenRequest)
channelID = ctrl.GetChannelNum (H323Capability::e_Transmit);
// TODO:
// - else if (submesId == H239Control::e_flowControlReleaseRequest)
// - channelID = ctrl.GetChannelNum (H323Capability::e_Receive);
if (!channelID)
channelID = connection.GetLogicalChannels()->GetLastChannelNumber()+1;
ctrl.SetRequestedChanNum(channelID); ctrl.SetRequestedChanNum(channelID);
buildGenericInteger(msg[1], H239Control::h239gpChannelId,channelID); buildGenericInteger(msg[1], H239Control::h239gpChannelId, channelID);
buildGenericInteger(msg[2], H239Control::h239gpSymmetryBreaking, 4); buildGenericInteger(msg[2], H239Control::h239gpSymmetryBreaking, PRandom::Nu
mber(1, 127));
} }
void BuildH239GenericMessageCommand(H239Control & ctrl, H323Connection & connect ion, H323ControlPDU& pdu, H239Control::H239SubMessages submesId, PBoolean option ) void BuildH239GenericMessageCommand(H239Control & ctrl, H323Connection & connect ion, H323ControlPDU & pdu, H239Control::H239SubMessages submesId, PBoolean optio n)
{ {
H245_GenericMessage & cap = pdu.Build(H245_CommandMessage::e_genericCommand) ; H245_GenericMessage & cap = pdu.Build(H245_CommandMessage::e_genericCommand) ;
H245_CapabilityIdentifier & id = cap.m_messageIdentifier; H245_CapabilityIdentifier & id = cap.m_messageIdentifier;
id.SetTag(H245_CapabilityIdentifier::e_standard); id.SetTag(H245_CapabilityIdentifier::e_standard);
PASN_ObjectId & gid = id; PASN_ObjectId & gid = id;
gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage); gid.SetValue(OpalPluginCodec_Identifer_H239_GenericMessage);
cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier); cap.IncludeOptionalField(H245_GenericMessage::e_subMessageIdentifier);
PASN_Integer & num = cap.m_subMessageIdentifier; PASN_Integer & num = cap.m_subMessageIdentifier;
skipping to change at line 1770 skipping to change at line 1778
cap.IncludeOptionalField(H245_GenericMessage::e_messageContent); cap.IncludeOptionalField(H245_GenericMessage::e_messageContent);
H245_ArrayOf_GenericParameter & msg = cap.m_messageContent; H245_ArrayOf_GenericParameter & msg = cap.m_messageContent;
msg.SetSize(2); msg.SetSize(2);
buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0); buildGenericInteger(msg[0], H239Control::h239gpTerminalLabel, 0);
buildGenericInteger(msg[1], H239Control::h239gpChannelId, ctrl.GetChannelNum (option ? H323Capability::e_Transmit : H323Capability::e_Receive)); buildGenericInteger(msg[1], H239Control::h239gpChannelId, ctrl.GetChannelNum (option ? H323Capability::e_Transmit : H323Capability::e_Receive));
} }
bool OnH239GenericMessageRequest(H239Control & ctrl, H323Connection & connection , const H245_ArrayOf_GenericParameter & content) bool OnH239GenericMessageRequest(H239Control & ctrl, H323Connection & connection , const H245_ArrayOf_GenericParameter & content)
{ {
PTRACE(4,"H239\tReceived Generic Request."); PTRACE(4, "H239\tReceived Generic Request.");
for (int i = 0; i < content.GetSize(); ++i) for (int i = 0; i < content.GetSize(); ++i)
{ {
H245_GenericParameter& param = content[i]; H245_GenericParameter& param = content[i];
switch ((PASN_Integer)param.m_parameterIdentifier) { switch ((PASN_Integer)param.m_parameterIdentifier) {
case H239Control::h239gpBitRate: case H239Control::h239gpBitRate:
break; break;
case H239Control::h239gpChannelId: case H239Control::h239gpChannelId:
ctrl.SetChannelNum((PASN_Integer)param.m_parameterValue, H323Capabil ity::e_Receive); ctrl.SetChannelNum((PASN_Integer)param.m_parameterValue, H323Capabil ity::e_Receive);
break; break;
case H239Control::h239gpSymmetryBreaking: case H239Control::h239gpSymmetryBreaking:
skipping to change at line 1793 skipping to change at line 1801
break; break;
} }
} }
// We send back to the connection to allow the implementor to delay the repl y message till it is ready.-SH // We send back to the connection to allow the implementor to delay the repl y message till it is ready.-SH
return connection.OnH239ControlRequest(&ctrl); return connection.OnH239ControlRequest(&ctrl);
} }
PBoolean OnH239GenericMessageResponse(H239Control & ctrl, H323Connection & conne ction, const H245_ArrayOf_GenericParameter & content) PBoolean OnH239GenericMessageResponse(H239Control & ctrl, H323Connection & conne ction, const H245_ArrayOf_GenericParameter & content)
{ {
PTRACE(4,"H239\tReceived Generic Response."); PTRACE(4, "H239\tReceived Generic Response.");
bool m_allowOutgoingExtVideo=true; bool allowOutgoingExtVideo = true;
unsigned channelID=0; unsigned channelID = 0;
int defaultSession=0; int defaultSession = connection.GetExtVideoRTPSessionID();
for (int i = 0; i < content.GetSize(); ++i) for (int i = 0; i < content.GetSize(); ++i)
{ {
H245_GenericParameter& param = content[i]; H245_GenericParameter& param = content[i];
switch ((PASN_Integer)param.m_parameterIdentifier) switch ((PASN_Integer)param.m_parameterIdentifier)
{ {
case H239Control::h239gpChannelId: case H239Control::h239gpChannelId:
channelID = (PASN_Integer)param.m_parameterValue; channelID = (PASN_Integer)param.m_parameterValue;
/* if (channelID == ctrl.GetChannelNum(H323Capability::e_Receive)) { /* if (channelID == ctrl.GetChannelNum(H323Capability::e_Receive)) {
PTRACE(4,"H239\tRec'd Response for Receive side. Close Receive Ch annel!"); PTRACE(4,"H239\tRec'd Response for Receive side. Close Receive Ch annel!");
ctrl.SendGenericMessage(H239Control::e_h245command, &connection, false); ctrl.SendGenericMessage(H239Control::e_h245command, &connection, false);
defaultSession = ctrl.GetRequestedChanNum(); defaultSession = ctrl.GetRequestedChanNum();
} */ } */
break; break;
case H239Control::h239gpAcknowledge: case H239Control::h239gpAcknowledge:
ctrl.SendGenericMessage(H239Control::e_h245indication, &connection); // send OwnerIndication
break; break;
case H239Control::h239gpReject: case H239Control::h239gpReject:
connection.OpenExtendedVideoSessionDenied(); connection.OpenExtendedVideoSessionDenied();
m_allowOutgoingExtVideo = false; allowOutgoingExtVideo = false;
break; break;
case H239Control::h239gpBitRate: case H239Control::h239gpBitRate:
case H239Control::h239gpSymmetryBreaking: case H239Control::h239gpSymmetryBreaking:
case H239Control::h239gpTerminalLabel: case H239Control::h239gpTerminalLabel:
break; break;
default: default:
m_allowOutgoingExtVideo = false; allowOutgoingExtVideo = false;
break; break;
} }
} }
if (channelID > 0 && channelID == ctrl.GetChannelNum(H323Capability::e_Trans mit)) { if (channelID > 0 && channelID == ctrl.GetChannelNum(H323Capability::e_Trans mit)) {
PTRACE(4,"H239\tLate Acknowledge IGNORE"); PTRACE(4, "H239\tLate Acknowledge IGNORE");
m_allowOutgoingExtVideo = false; allowOutgoingExtVideo = false;
} }
if (m_allowOutgoingExtVideo) if (allowOutgoingExtVideo)
return connection.OpenExtendedVideoSession(ctrl.GetChannelNum(H323Capabi lity::e_Transmit), defaultSession); return connection.OpenExtendedVideoSession(ctrl.GetChannelNum(H323Capabi lity::e_Transmit), defaultSession);
return true; return true;
} }
PBoolean OnH239GenericMessageCommand(H239Control & ctrl, H323Connection & connec tion, const H245_ArrayOf_GenericParameter & content) PBoolean OnH239GenericMessageCommand(H239Control & ctrl, H323Connection & connec tion, const H245_ArrayOf_GenericParameter & content)
{ {
PTRACE(4,"H239\tReceived Generic Command."); PTRACE(4, "H239\tReceived Generic Command.");
return connection.OnH239ControlCommand(&ctrl); return connection.OnH239ControlCommand(&ctrl);
} }
/////////////////////////////////////////// ///////////////////////////////////////////
H323ControlExtendedVideoCapability::H323ControlExtendedVideoCapability() H323ControlExtendedVideoCapability::H323ControlExtendedVideoCapability()
: H323ExtendedVideoCapability(OpalPluginCodec_Identifer_H239) : H323ExtendedVideoCapability(OpalPluginCodec_Identifer_H239)
, m_outgoingChanNum(0, false), m_incomingChanNum(0,false), m_requestedChanNum( , m_outgoingChanNum(0, false), m_incomingChanNum(0, false), m_requestedChanNum
0) (0)
{
}
unsigned H323ControlExtendedVideoCapability::GetDefaultSessionID() const
{ {
return OpalMediaFormat::NonRTPSessionID;
} }
PBoolean H323ControlExtendedVideoCapability::CloseChannel(H323Connection * conne ction, H323Capability::CapabilityDirection dir) PBoolean H323ControlExtendedVideoCapability::CloseChannel(H323Connection * conne ction, H323Capability::CapabilityDirection dir)
{ {
SendGenericMessage(H239Control::e_h245command, connection, dir == H323Capabil ity::e_Transmit); SendGenericMessage(H239Control::e_h245command, connection, dir == H323Capabil ity::e_Transmit);
return connection->CloseExtendedVideoSession(GetChannelNum(dir)); return connection->CloseExtendedVideoSession(GetChannelNum(dir));
} }
PBoolean H323ControlExtendedVideoCapability::SendGenericMessage(h245MessageType msgtype, H323Connection * connection, PBoolean option) PBoolean H323ControlExtendedVideoCapability::SendGenericMessage(h245MessageType msgtype, H323Connection * connection, PBoolean option)
{ {
H323ControlPDU pdu; H323ControlPDU pdu;
switch (msgtype) { switch (msgtype) {
case e_h245request: case e_h245request:
BuildH239GenericMessageRequest(*this,*connection,pdu,H239Control::e_ presentationTokenRequest); BuildH239GenericMessageRequest(*this,* connection, pdu, H239Control: :e_presentationTokenRequest);
break; break;
case e_h245response: case e_h245response:
BuildH239GenericMessageResponse(*this,*connection,pdu,H239Control::e _presentationTokenResponse,option); BuildH239GenericMessageResponse(*this, *connection, pdu, H239Control ::e_presentationTokenResponse, option);
break; break;
case e_h245command: case e_h245command:
BuildH239GenericMessageCommand(*this, *connection, pdu, H239Control: :e_presentationTokenRelease,option); BuildH239GenericMessageCommand(*this, *connection, pdu, H239Control: :e_presentationTokenRelease, option);
break; break;
case e_h245indication: case e_h245indication:
BuildH239GenericMessageIndication(*this, *connection, pdu, H239Contr
ol::e_presentationTokenIndicateOwner);
break;
default: default:
return true; return true;
} }
return connection->WriteControlPDU(pdu); return connection->WriteControlPDU(pdu);
} }
PBoolean H323ControlExtendedVideoCapability::HandleGenericMessage(h245MessageTyp e type, PBoolean H323ControlExtendedVideoCapability::HandleGenericMessage(h245MessageTyp e type,
H323Connection * con, H323Connection * con,
const H245_ArrayOf_GenericParamete r * pdu) const H245_ArrayOf_GenericParamete r * pdu)
{ {
switch (type) { switch (type) {
case e_h245request: case e_h245request:
return OnH239GenericMessageRequest(*this,*con,*pdu); return OnH239GenericMessageRequest(*this, *con, *pdu);
case e_h245response: case e_h245response:
return OnH239GenericMessageResponse(*this,*con,*pdu); return OnH239GenericMessageResponse(*this, *con, *pdu);
case e_h245command: case e_h245command:
return OnH239GenericMessageCommand(*this,*con,*pdu); return OnH239GenericMessageCommand(*this, *con, *pdu);
case e_h245indication: case e_h245indication:
default: default:
return true; return true;
} }
} }
H323ChannelNumber & H323ControlExtendedVideoCapability::GetChannelNum(H323Capabi lity::CapabilityDirection dir) H323ChannelNumber & H323ControlExtendedVideoCapability::GetChannelNum(H323Capabi lity::CapabilityDirection dir)
{ {
switch (dir) { switch (dir) {
case e_Transmit: case e_Transmit:
skipping to change at line 1983 skipping to change at line 1999
{ {
return H245_VideoCapability::e_extendedVideoCapability; return H245_VideoCapability::e_extendedVideoCapability;
} }
PObject * H323CodecExtendedVideoCapability::Clone() const PObject * H323CodecExtendedVideoCapability::Clone() const
{ {
return new H323CodecExtendedVideoCapability(*this); return new H323CodecExtendedVideoCapability(*this);
} }
H323Channel * H323CodecExtendedVideoCapability::CreateChannel(H323Connection & c onnection, H323Channel * H323CodecExtendedVideoCapability::CreateChannel(H323Connection & c onnection,
H323Channel::Directions dir,unsigned sessionID,const H245_H2250LogicalChan nelParameters * param H323Channel::Directions dir, unsigned sessionID, const H245_H2250LogicalCh annelParameters * param
) const ) const
{ {
if (table.GetSize() == 0) if (table.GetSize() == 0)
return NULL; return NULL;
return connection.CreateRealTimeLogicalChannel(*this, dir, sessionID, param); return connection.CreateRealTimeLogicalChannel(*this, dir, sessionID, param);
} }
H323Codec * H323CodecExtendedVideoCapability::CreateCodec(H323Codec::Direction d irection ) const H323Codec * H323CodecExtendedVideoCapability::CreateCodec(H323Codec::Direction d irection ) const
{ {
skipping to change at line 2067 skipping to change at line 2083
PASN_Integer & pId = param.m_parameterIdentifier; PASN_Integer & pId = param.m_parameterIdentifier;
pId = 1; pId = 1;
param.m_parameterValue.SetTag(H245_ParameterValue::e_booleanArray); param.m_parameterValue.SetTag(H245_ParameterValue::e_booleanArray);
PASN_Integer & pVal = param.m_parameterValue; PASN_Integer & pVal = param.m_parameterValue;
pVal = 1; pVal = 1;
H245_ArrayOf_VideoCapability & caps = extend.m_videoCapability; H245_ArrayOf_VideoCapability & caps = extend.m_videoCapability;
if (extCapabilities.GetSize() > 0) { if (extCapabilities.GetSize() > 0) {
caps.SetSize(extCapabilities.GetSize()); caps.SetSize(extCapabilities.GetSize());
for (PINDEX i=0; i< extCapabilities.GetSize(); i++) { for (PINDEX i = 0; i < extCapabilities.GetSize(); i++) {
H245_VideoCapability vidcap; H245_VideoCapability vidcap;
((H323VideoCapability &)extCapabilities[i]).OnSendingPDU(vidcap,ctype); ((H323VideoCapability &)extCapabilities[i]).OnSendingPDU(vidcap, ctype) ;
caps[i] = vidcap; caps[i] = vidcap;
} }
} else { } else {
caps.SetSize(table.GetSize()); caps.SetSize(table.GetSize());
for (PINDEX i=0; i< table.GetSize(); i++) { for (PINDEX i=0; i< table.GetSize(); i++) {
H245_VideoCapability vidcap; H245_VideoCapability vidcap;
((H323VideoCapability &)table[i]).OnSendingPDU(vidcap,ctype); ((H323VideoCapability &)table[i]).OnSendingPDU(vidcap, ctype);
caps[i] = vidcap; caps[i] = vidcap;
} }
} }
return TRUE; return TRUE;
} }
PBoolean H323CodecExtendedVideoCapability::OnReceivedPDU(const H245_VideoCapabil ity & pdu ) PBoolean H323CodecExtendedVideoCapability::OnReceivedPDU(const H245_VideoCapabil ity & pdu )
{ {
if (pdu.GetTag() != H245_VideoCapability::e_extendedVideoCapability) if (pdu.GetTag() != H245_VideoCapability::e_extendedVideoCapability)
skipping to change at line 2168 skipping to change at line 2184
return TRUE; return TRUE;
} }
PObject::Comparison H323CodecExtendedVideoCapability::Compare(const PObject & ob j) const PObject::Comparison H323CodecExtendedVideoCapability::Compare(const PObject & ob j) const
{ {
if (!PIsDescendant(&obj, H323CodecExtendedVideoCapability)) if (!PIsDescendant(&obj, H323CodecExtendedVideoCapability))
return LessThan; return LessThan;
const H323CodecExtendedVideoCapability & cap = (const H323CodecExtendedVideoCa pability &)obj; const H323CodecExtendedVideoCapability & cap = (const H323CodecExtendedVideoCa pability &)obj;
for (PINDEX i= 0; i< GetSize(); ++i) { for (PINDEX i = 0; i < GetSize(); ++i) {
for (PINDEX j=0; j< GetSize(); ++j) { for (PINDEX j = 0; j < GetSize(); ++j) {
H323Capability * local = GetAt(i); H323Capability * local = GetAt(i);
H323Capability * remote = cap.GetAt(j); H323Capability * remote = cap.GetAt(j);
if (!local || !remote) continue; if (!local || !remote) continue;
PObject::Comparison equal = local->Compare(*remote); PObject::Comparison equal = local->Compare(*remote);
if (equal == EqualTo) if (equal == EqualTo)
return EqualTo; return EqualTo;
} }
} }
skipping to change at line 3855 skipping to change at line 3871
if ((capability.GetMainType() == H323Capability::e_Video) && if ((capability.GetMainType() == H323Capability::e_Video) &&
(capability.GetSubType() != H245_VideoCapability::e_extended VideoCapability)) { (capability.GetSubType() != H245_VideoCapability::e_extended VideoCapability)) {
PCaselessString str = table[i].GetFormatName(); PCaselessString str = table[i].GetFormatName();
PString formatName = "*-*"; PString formatName = "*-*";
PStringArray wildcard = formatName.Tokenise('*', FALSE); PStringArray wildcard = formatName.Tokenise('*', FALSE);
if (!MatchWildcard(str, wildcard)) if (!MatchWildcard(str, wildcard))
genericCaps.AppendString(str); genericCaps.AppendString(str);
} }
} }
#if PTLIB_VER >= 2130 #if PTLIB_VER >= 2130
Remove("",genericCaps); Remove("", genericCaps);
#else #else
Remove(genericCaps); Remove(genericCaps);
#endif #endif
} }
// Instruct remaining Video Capabilities to set Frame Size to new Value // Instruct remaining Video Capabilities to set Frame Size to new Value
for (PINDEX i = 0; i < table.GetSize(); i++) { for (PINDEX i = 0; i < table.GetSize(); i++) {
H323Capability & capability = table[i]; H323Capability & capability = table[i];
if (capability.GetMainType() == H323Capability::e_Video) if (capability.GetMainType() == H323Capability::e_Video)
capability.SetMaxFrameSize(frameSize,frameUnits); capability.SetMaxFrameSize(frameSize,frameUnits);
 End of changes. 35 change blocks. 
45 lines changed or deleted 63 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)