From: Robert J. <rjo...@us...> - 2005-08-31 13:19:34
|
Update of /cvsroot/openh323/opal/src/h323 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28138/src/h323 Modified Files: channels.cxx Log Message: Added mechanism for controlling media (especially codecs) including changing the OpalMediaFormat option list (eg bit rate) and a completely new OpalMediaCommand abstraction for things like video fast update. Index: channels.cxx =================================================================== RCS file: /cvsroot/openh323/opal/src/h323/channels.cxx,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** channels.cxx 11 Jul 2005 01:52:24 -0000 2.26 --- channels.cxx 31 Aug 2005 13:19:25 -0000 2.27 *************** *** 28,31 **** --- 28,36 ---- * * $Log$ + * Revision 2.27 2005/08/31 13:19:25 rjongbloed + * Added mechanism for controlling media (especially codecs) including + * changing the OpalMediaFormat option list (eg bit rate) and a completely + * new OpalMediaCommand abstraction for things like video fast update. + * * Revision 2.26 2005/07/11 01:52:24 csoutheren * Extended AnsweringCall to work for SIP as well as H.323 *************** *** 563,566 **** --- 568,572 ---- #include <opal/transports.h> + #include <codec/vidcodec.h> #include <h323/h323ep.h> #include <h323/h323con.h> *************** *** 593,604 **** } - #else // Stuff to remove unused parameters warning - #define PTRACE_bitRateRestriction - #define PTRACE_type - #define PTRACE_jitter - #define PTRACE_skippedFrameCount - #define PTRACE_additionalBuffer - #define PTRACE_direction - #endif --- 599,602 ---- *************** *** 734,765 **** ! void H323Channel::OnFlowControl(long PTRACE_bitRateRestriction) { ! PTRACE(3, "LogChan\tOnFlowControl: " << PTRACE_bitRateRestriction); } ! void H323Channel::OnMiscellaneousCommand(const H245_MiscellaneousCommand_type & PTRACE_type) { ! PTRACE(3, "LogChan\tOnMiscellaneousCommand: chan=" << number ! << ", type=" << PTRACE_type.GetTagName()); } ! void H323Channel::OnMiscellaneousIndication(const H245_MiscellaneousIndication_type & PTRACE_type) { PTRACE(3, "LogChan\tOnMiscellaneousIndication: chan=" << number ! << ", type=" << PTRACE_type.GetTagName()); } ! void H323Channel::OnJitterIndication(DWORD PTRACE_jitter, ! int PTRACE_skippedFrameCount, ! int PTRACE_additionalBuffer) { PTRACE(3, "LogChan\tOnJitterIndication:" ! " jitter=" << PTRACE_jitter << ! " skippedFrameCount=" << PTRACE_skippedFrameCount << ! " additionalBuffer=" << PTRACE_additionalBuffer); } --- 732,762 ---- ! void H323Channel::OnFlowControl(long PTRACE_PARAM(bitRateRestriction)) { ! PTRACE(3, "LogChan\tOnFlowControl: " << bitRateRestriction); } ! void H323Channel::OnMiscellaneousCommand(const H245_MiscellaneousCommand_type & PTRACE_PARAM(type)) { ! PTRACE(3, "LogChan\tOnMiscellaneousCommand: chan=" << number << ", type=" << type.GetTagName()); } ! void H323Channel::OnMiscellaneousIndication(const H245_MiscellaneousIndication_type & PTRACE_PARAM(type)) { PTRACE(3, "LogChan\tOnMiscellaneousIndication: chan=" << number ! << ", type=" << type.GetTagName()); } ! void H323Channel::OnJitterIndication(DWORD PTRACE_PARAM(jitter), ! int PTRACE_PARAM(skippedFrameCount), ! int PTRACE_PARAM(additionalBuffer)) { PTRACE(3, "LogChan\tOnJitterIndication:" ! " jitter=" << jitter << ! " skippedFrameCount=" << skippedFrameCount << ! " additionalBuffer=" << additionalBuffer); } *************** *** 886,889 **** --- 883,926 ---- + void H323UnidirectionalChannel::OnMiscellaneousCommand(const H245_MiscellaneousCommand_type & type) + { + H323Channel::OnMiscellaneousCommand(type); + + if (mediaStream == NULL) + return; + + switch (type.GetTag()) + { + case H245_MiscellaneousCommand_type::e_videoFreezePicture : + mediaStream->ExecuteCommand(OpalVideoFreezePicture()); + break; + + case H245_MiscellaneousCommand_type::e_videoFastUpdatePicture: + mediaStream->ExecuteCommand(OpalVideoUpdatePicture()); + break; + + case H245_MiscellaneousCommand_type::e_videoFastUpdateGOB : + { + const H245_MiscellaneousCommand_type_videoFastUpdateGOB & fuGOB = type; + mediaStream->ExecuteCommand(OpalVideoUpdatePicture(fuGOB.m_firstGOB, -1, fuGOB.m_numberOfGOBs)); + } + break; + + case H245_MiscellaneousCommand_type::e_videoFastUpdateMB : + { + const H245_MiscellaneousCommand_type_videoFastUpdateMB & vfuMB = type; + mediaStream->ExecuteCommand(OpalVideoUpdatePicture(vfuMB.HasOptionalField(H245_MiscellaneousCommand_type_videoFastUpdateMB::e_firstGOB) ? (int)vfuMB.m_firstGOB : -1, + vfuMB.HasOptionalField(H245_MiscellaneousCommand_type_videoFastUpdateMB::e_firstMB) ? (int)vfuMB.m_firstMB : -1, + vfuMB.m_numberOfMBs)); + } + break; + + case H245_MiscellaneousCommand_type::e_videoTemporalSpatialTradeOff : + mediaStream->ExecuteCommand(OpalTemporalSpatialTradeOff((const PASN_Integer &)type)); + break; + } + } + + OpalMediaStream * H323UnidirectionalChannel::GetMediaStream() const { |