<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Simon,<br>
<br>
I used fixed width and height to determine display and reader working, and I traced again my application.<br>
<br>
This time I went deeper into the h323plus library, I think it's a bug
of h323plus, between the library and the video codec plugin.<br>
<br>
Bug Scenario:<br>
<br>
I have set <br>
<br>
<b> AddAllCapabilities(0, P_MAX_INDEX, "*");</b><br>
<br>
I only use H261 this time<br>
<br>
<b> SetVideoFrameSize(H323Capability::cifMPI);<br>
</b><br>
Set the maximum Frame size and send a kind of parameter cifTag to the plugin<br>
<br>
<br>
on my <b>OnVideoChannel </b>I initialise <br>
<br>
if (encoder) <br>
codec.SetFrameSize(176, 144);<br>
<br>
This is the call stack by chronological order for an h323 video call
using a CIF<->QCIF endpoint (trace is for endpoint that sending
qcif)<br>
<br>
<i><b>1) H323PluginVideoCodec::H323PluginVideoCodec(...)</b></i><br>
<br>
it creates the encoder, and set frame size to CIF (the default plugin maximum value)<br>
<br>
<br>
<i><b>2) H323PluginVideoCodec::SetFrameSize(...)</b></i><br>
<br>
it adjusts the frame size, called from my OnVideoChannel, with qcif Value<br>
<br>
<br>
<i><b>3) H323PluginVideoCodec::Read</b></i>(...)<br>
<br>
All work, my rawChannel, renderer, etc... until I reach line 1690<br>
<br>
H323pluginmgr.cxx::1690 - THE FIRST READ call to encode video fails<br>
<br>
<br>
<font style="" color="#ff0000"> int retval = (codec->codecFunction)(codec, context, </font><font style="" color="#ff0000"><br>
</font><font style="" color="#ff0000"> bufferRTP.GetPointer(), &fromLen,</font><font style="" color="#ff0000"><br>
</font><font style="" color="#ff0000"> dst.GetPointer(), &toLen,</font><font style="" color="#ff0000"><br>
</font><font style="" color="#ff0000"> &flags);</font><font style="" color="#ff0000"><br>
</font><br>
retval = 0, which results into closing the channel as it returns false,<br>
<br>
<br>
if I change <b>SetVideoFrameSize(H323Capability::cifMPI);</b> into <b>SetVideoFrameSize(H323Capability::qcifMPI);<br>
</b><br>
The codec function works again, but naturally with qCIF on both sides<br>
<br>
I think that once the codec parameter was tagged to use a cif or a qcif
it can't change resolution during the call. so the encoding function
fail for a resolution different than one setted using the
SetVideoFrameSize.<br>
<br>
It's likely that the SetVideoFrameSize send an additional information
to plugin code using a setcontrolcodec which are required later so the
encoding function works properly.<br>
<br>
I noticed, that video resolution fail is only a local behaviour, and has nothing to do with remote endpoint.<br>
<br>
I will be debugging more, I still don't know the plugin code so much,
so you might have a clearer idea than me? I think if you make a simple
test you would encounter the same behaviour!<br>
<br>
Thanks<br>
<b><br>
<br>
</b><br><br><hr id="stopSpelling">From: s.horne@packetizer.com<br>To: unazona@hotmail.com; h323plus@lists.packetizer.com<br>Subject: RE: [h323plus] Video Resolution<br>Date: Sat, 16 Jan 2010 01:37:07 +1000<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Verdana;font-size:10pt;}
</style>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial">Carlos</font></span></div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial">You cannot know what the remote will send when you call
OpenVideoChannel for the decoding side, that can only be done when you
receive the first RTP packets. </font></span></div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial">You need to do a level 6 trace to work out who and why the
channel is being closed. I don't think it is a capability issue, usually the
problem comes from either the video encoder device (webcam) or the display
device. Check to see that you have set the video input device to
send at the same size as your encoder. The old openH323 used
to do be able to do that automatically as the frame size for the
capability was known. You have to make sure the input
to the encoder from the webcam is correct. </font></span></div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial">Version of h323plus would be irrelevent in this case.
</font></span></div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecx498361615-15012010"><font color="#0000ff" face="Arial">Simon</font></span></div><br>
<div dir="ltr" class="ecxOutlookMessageHeader" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> Carlos Haj [mailto:unazona@hotmail.com]
<br><b>Sent:</b> Saturday, 16 January 2010 1:06 AM<br><b>To:</b>
s.horne@spranto.com.au; s.horne@packetizer.com;
h323plus@lists.packetizer.com<br><b>Subject:</b> RE: [h323plus] Video
Resolution<br></font><br></div>
<div></div>Simon,<br><br>Thanks for valuable information. What is happening
literally in a minimised case: I derived OnVideoChannel<br><br>on the Local
endpoint<br><br><font style="font-size: 8pt;" size="1">if (encoding)</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">{</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
codec.SetFrameSize(352, 288);</font><font style="font-size: 8pt;" size="1"><br>.....<br></font><font style="font-size: 8pt;" size="1">}</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">else</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">{</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> cout <<
codec.GetWidth();</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> cout <<
codec.GetHeight();</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> // I receive CIF
(ERROR)</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">.....<br></font><font style="font-size: 8pt;" size="1"></font><font style="font-size: 8pt;" size="1">}</font><br><br>on the Remote
endpoint<br><br><font style="font-size: 8pt;" size="1">if (encoding)</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">{</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
codec.SetFrameSize(176, 144);</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">.....<br></font><font style="font-size: 8pt;" size="1"></font><font style="font-size: 8pt;" size="1">}</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">else</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">{</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> cout <<
codec.GetWidth();</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> cout <<
codec.GetHeight();</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1"> // I receive
CIF</font><font style="font-size: 8pt;" size="1"> (normal)</font><font style="font-size: 8pt;" size="1"><br></font> <font style="font-size: 8pt;" size="1">.....<br></font><font style="font-size: 8pt;" size="1"></font><font style="font-size: 8pt;" size="1">}</font><br><br>I looked into H323 trace Log,
(remote endpoint which supposed to send QCIF)
<br><br>PLUGIN Error encoding frame from
plugin H.261-CIF<br>H245
Request CloseLogicalChannel<br>H323RTP Transmit
H.261-CIF thread ended<br><br>It seems that the H.261 channel is closed
prematurely. As my local endpoint received an incorrect video size I suppose
that local endpoint causes remote to close the transmission
channel.<br><br>Could this be related to the version of the plugin or h323plus
lib which I use? it's likely that the video resolution is sent before
codec.SetFrameSize is invoked!<br><br>Did you in practice used different video
resolution under the same capability? e.g. CIF<->QCIF
calls<br><br>Carlos<br><br>
<hr id="ecxstopSpelling">
From: s.horne@spranto.com.au<br>To: unazona@hotmail.com; s.horne@packetizer.com;
h323plus@lists.packetizer.com<br>Subject: RE: [h323plus] Video
Resolution<br>Date: Fri, 15 Jan 2010 23:14:23 +1000<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Verdana;font-size:10pt;}
</style>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">Carlos</font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">The current behaviour is correct. </font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">The old OpenH323 used to only send CIF with *-CIF{sw}
capability and only QCIF with *-QCIF{sw} . This was
changed with the video plugins so the capability could do up to CIF so
it would also supported QCIF. This is perfectly
H.245 legal.</font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">In this way only 1 capability can do both frame sizes.
</font></span><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">This is the way most manufacturers implement the capability
exchange. </font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">The capability has a flag for the size it supports so the old CIF
capability used to say QCIF - 0 CIF - 1. So if you wanted to do QCIF you
had to use the *-QCIF{sw} capability as the QCIF flag in the *-CIF{sw} was 0.
This was changed so that the *-CIF{sw} capability had the QCIF flag so it could
also support QCIF. Then it was safe to remove the *-QCIF{sw} capability and only
exchange using the *-CIF{sw}. </font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">Now SetVideoFrameSize() will set the global frame size limit so
regardless of the direction that will be the maximum size permitted (if CIF
only up to CIF capability is available). The codec.FrameSize() in the
MyH323Endpoint::OpenVideoChannel() allows the implementor to set the
actual frame size to send. </font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">Is there something else I missed?</font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial">Simon</font></span></div>
<div dir="ltr" align="left"><span class="ecxecx437140412-15012010"><font color="#0000ff" face="Arial"></font></span> </div><span class="ecxecx437140412-15012010"></span><font color="#0000ff" face="Arial"> </font><br>
<div dir="ltr" class="ecxecxOutlookMessageHeader" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> Carlos Haj [mailto:unazona@hotmail.com]
<br><b>Sent:</b> Friday, 15 January 2010 8:39 PM<br><b>To:</b>
s.horne@packetizer.com; h323plus@lists.packetizer.com<br><b>Subject:</b> RE:
[h323plus] Video Resolution<br></font><br></div>
<div></div>Simon,<br><br>Thanks for your quick answer, just noticed that I had a
bad thread name;)<br><br>Well, I have the codec.SetFrameSize(w, h); in my
OpenVideoChannel<br><br>When adding capabilities I
use<br><br><b>AddAllCapabilities(0, P_MAX_INDEX,
"*");<br>SetVideoFrameSize(H323Capability::cifMPI);</b><br><br>Capabilities
table shows as <br><b><br></b><i><b>Set 0: 0:
audio<br> 1:
H.261-CIF{sw}</b><br></i><br>I receive an OpenVideoChannel for encoder, I open
channel and attach video reader + colourConverter, just after that I receive a
close video signal from a H245Negotation, here I join Call Stack<br><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">> testApp.exe!mmDDSVideoOutputBridge::close2() Ligne
359 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!mmVideoInputDevice::~mmVideoInputDevice() Ligne 43 +
0x1b C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!mmVideoInputDevice::`scalar deleting destructor'() +
0x2b C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!PVideoChannel::CloseVideoReader() Ligne 203 +
0x24 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!PVideoChannel::Close() Ligne 145
C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Codec::CloseRawDataChannel() Ligne 488 +
0x11 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323VideoCodec::Close() Ligne 747
C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Channel::CleanUpOnTermination() Ligne
716 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323_RTPChannel::CleanUpOnTermination() Ligne
1160 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H245NegLogicalChannel::Release() Ligne 1219
C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H245NegLogicalChannel::HandleCloseAck(const
H245_CloseLogicalChannelAck & __formal={...}) Ligne
1086 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H245NegLogicalChannels::HandleCloseAck(const
H245_CloseLogicalChannelAck & pdu={...}) Ligne 1372 +
0xf C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Connection::OnH245Response(const H323ControlPDU &
pdu={...}) Ligne 3293 + 0x22 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Connection::HandleControlPDU(const H323ControlPDU &
pdu={...}) Ligne 3189 + 0x12 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Connection::HandleControlData(PPER_Stream &
strm={...}) Ligne 3170 + 0x18 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Connection::HandleReceivedControlPDU(bool readStatus=true,
PPER_Stream & strm={...}) Ligne 3103 + 0x12
C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H323Connection::HandleControlChannel() Ligne 3085 +
0x13 C++</font><font style="font-size: 8pt;" size="1"><br></font><font style="font-size: 8pt;" size="1">
testApp.exe!H245TransportThread::Main() Ligne 700
C++</font><b><br></b><br><br>If I remove the
"SetVideoFrameSize(H323Capability::cifMPI);", I get the following capabilities
set<br><br><b>1: H.261-CIF{sw}<br>
H.261-QCIF{sw}<br> H.261{sw}</b><br><br>with exactly same
strange behaviour, QCIF is not sending while CIF is being received, by the way
qcif endpoint says<br><br>Local Video Codec - H.261-CIF{sw}<br>Local Resolution
- 176x144<br><br>Remote Video Codec - H.261-CIF{sw}<br>Remote Resolution -
352x288<br><br><br>I tried a "ReorderCapabilities(PStringArray("QCIF"));" after
my addcapabilities, I ended up with both endpoints using QCIF and ignoring my
SetFrameSize anyway!!<br><br>Is there a glitch using H323Plus video plugins? my
code works perfectly on openh323
stack.<br><br>"SetVideoFrameSize(H323Capability::cifMPI);" is supposed to define
a maximum video resolution?! as you said in API doc <b>"... to set the maximum
framesize allowed to the specified value "</b><br><br>Is that usual to have
H.261-CIF with a QCIF resolution? On which order codec plugins can be added to
avoid such problems of negotiation?<br><br>Regards<br><br>
<hr id="ecxecxstopSpelling">
From: s.horne@packetizer.com<br>To: unazona@hotmail.com;
h323plus@lists.packetizer.com<br>Subject: RE: [h323plus] Valid sessionID in
OpenLogicalChannel command<br>Date: Fri, 15 Jan 2010 08:12:54 +1000<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Verdana;font-size:10pt;}
</style>
<div dir="ltr" align="left"><font face="Arial"><span class="ecxecxecx442210022-14012010">Carlos</span></font></div>
<div dir="ltr" align="left"><font face="Arial"><span class="ecxecxecx442210022-14012010"></span></font> </div>
<div dir="ltr" align="left"><span class="ecxecxecx442210022-14012010"><font face="Arial"><span class="ecxecxecx442210022-14012010">In your
derived</span></font><br><font face="Arial"><span class="ecxecxecx442210022-14012010"></span>H323EndPoint::OpenVideoChannel(<span class="ecxecxecx442210022-14012010">()</span></font><br><font face="Arial"><span class="ecxecxecx442210022-14012010"></span></font> <br><font face="Arial"><span class="ecxecxecx442210022-14012010">(isEncoding)</span></font><br><span class="ecxecxecx442210022-14012010"><font face="Arial"><span class="ecxecxecx442210022-14012010">
</span>codec.SetFrameSize(w,h);</font><br> <br><span class="ecxecxecx442210022-14012010"><font face="Arial">Simon</font></span><br> <br> <br> <br></span></span></div><br>
<div dir="ltr" class="ecxecxecxOutlookMessageHeader" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> h323plus-bounces@lists.packetizer.com
[mailto:h323plus-bounces@lists.packetizer.com] <b>On Behalf Of </b>Carlos
Haj<br><b>Sent:</b> Friday, 15 January 2010 12:59 AM<br><b>To:</b>
h323plus@lists.packetizer.com<br><b>Subject:</b> Re: [h323plus] Valid sessionID
in OpenLogicalChannel command<br></font><br></div>
<div id="ecxecxecxMsgContainer" class="ecxecxecxExternalClass">
<style>
.ExternalClass .ecxhmmessage P
{padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px;}
.ExternalClass BODY.ecxhmmessage
{font-family:Verdana;font-size:10pt;}
</style>
Hello Guys,<br><br>I would like to have different frame sizes for two endpoints,
first I tried to play around with H323Endpoint::SetVideoFrameSize, but it seems
that part changes the maximum allowed size, which means that if I switch the
videoFrameSize to qCIF, I wouldn't be able to receive CIF from the other
endpoint. my test only received QCIF.<br><br>I tried also to modify the
OpalMediaFormat by using a GetWritableMediaFormat for a capability, that ended
with unusual CIF format while having a QCIF resolution.<br><br>On the other
hand, I looked Opal examples where they use an OpalManager, but unfortuntly that
seems incompatible with h323plus, while old openh323 tutorials and exampls don't
have any video plugins support.<br><br>How I can manage to receive and send
different resolutions (frame sizes) using H323plus?<br><br>I appreciate a lot
your help<br>Carlos<br><br><br></div><a href="http://clk.atdmt.com/FRM/go/182932252/direct/01/"></a><br>
<hr>
Discute avec tes amis partout, grâce à Messenger sur ton mobile. <a href="http://www.messengersurvotremobile.com/">Cliquez ici !</a> <br>
<hr>
Avec Internet Explorer, surfez en toute discrétion sur internet <a href="http://clk.atdmt.com/FRM/go/182932252/direct/01/">Cliquez ici
!</a> <br /><hr />Avec Internet Explorer, surfez en toute discrétion sur internet <a href='http://clk.atdmt.com/FRM/go/182932252/direct/01/' target='_new'>Cliquez ici !</a></body>
</html>