Re: [Opalvoip-user] video sink stream is not created after source exists ?
Brought to you by:
csoutheren,
rjongbloed
From: Vladimir F. <vla...@gm...> - 2011-02-02 12:29:28
|
Hello all, ok it works now :-) there is no problem (I set initial bandwith for h323 too low). Cheers, Vladimir On Wed, Feb 2, 2011 at 10:32 AM, Vladimir Fekete <vla...@gm...>wrote: > Hello all, > > I came into strange situation and I would like to ask you for a opinion. > Is there any reason why would not OPAL wants to create video sink stream > after it crated video source stream ? > My situation: > > partyA: my OPAL based application with classes for local end point, h323 > endpoint, local connection, local media stream, opal video stream > partyB: H323+ automatic answering machine which reply with both audio and > video. > > when I set up call A -> B, I'm trying to react on requests for creation of > streams for both audio and video source and sink (e.g. 4 streams). > Concerning audio streams - everything is OK, they both work (source and > sinktogether), however I cannot create both source and video streams (code > flow will not enter CreateMediaStream twice although I see that there is a > stream for H323 H.261 Sink,). > > Strange thing is, that when I create only video source, or only video sink, > they works (separately). But not together. Don't you have any clues what > could possibly cause this situation ? > > Thank you very much! > > Best regards, > > Vladimir Fekete > > My output is : > > #======================================================= > AUDIO SOURCE > > VIDEO SOURCE > > CIF MPI = 1 - 1 > Frame Time = 3003 - 3003 > Rate Control Enable = 0 - 0 > Rate Controller = - 0 > Frame Height = 288 - 288 > Protocol = - 0 > Max Bit Rate = 621700 - 621700 > Clock Rate = 90000 - 90000 > Max Rx Frame Height = 288 - 288 > Max Rx Frame Width = 352 - 352 > QCIF MPI = 4 - 4 > Min Rx Frame Height = 96 - 96 > Min Rx Frame Width = 128 - 128 > Annex D = 0 - 0 > Max Tx Packet Size = 8192 - 8192 > Target Bit Rate = 621700 - 621700 > Frame Width = 352 - 352 > Content Role = No Role - 0 > Content Role Mask = 0 - 0 > Tx Key Frame Period = 125 - 125 > > AUDIO SINK > > hang <-- I hanged it after a while (3 seconds) > > =================== > Call statistics > =================== > A Rx/Tx 101/150 > V Rx/Tx 0/101 > > #======================================================= > > my CreateMediaStream method: > > OpalMediaStream* MyLocalConnection::CreateMediaStream(const OpalMediaFormat > &mediaFormat, unsigned sessionID, PBoolean isSource) > { > if (mediaFormat.GetMediaType() == OpalMediaType::Audio() && isSource) > cout << "AUDIO SOURCE" << endl; > else if (mediaFormat.GetMediaType() == OpalMediaType::Audio() && !isSource) > cout << "AUDIO SINK" << endl; > else if (mediaFormat.GetMediaType() == OpalMediaType::Video() && isSource) > cout << "VIDEO SOURCE" << endl; > else if (mediaFormat.GetMediaType() == OpalMediaType::Video() && !isSource) > cout << "VIDEO SINK" << endl; > > OpalMediaStream* oms = NULL; > > //let's make sure we create everything only once > static bool source = false; > static bool sink = false; > > static bool Asource = false; > static bool Asink = false; > > > if (mediaFormat.GetMediaType() == OpalMediaType::Audio() && isSource) > { > if (Asource) > return NULL; > > Asource = true; > oms = new MyLocalMediaStream(*this, mediaFormat, sessionID, isSource, > true); > } > else if (mediaFormat.GetMediaType() == OpalMediaType::Audio() && > !isSource) > { > > if (Asink) > return NULL; > > Asink = true; > > oms = new MyLocalMediaStream(*this, mediaFormat, sessionID, isSource, > true); > > } > else if (mediaFormat.GetMediaType() == OpalMediaType::Video()) > { > PVideoInputDevice *pvid = NULL; > PVideoOutputDevice *pvod = NULL; > > > //HERE WHEN I CREATE SOURCE, SINK IS IGNORED (CODE FLOW DOES NOT ENTERS > THIS METHOD ANYMORE) > if (isSource == false && sink == false) > { > sink = true; > oms = new MyLocalMediaStream(*this, mediaFormat, sessionID, isSource, > false); > } > else if (source == false) > { > source = true; > pvid = new MyVideoInputDevice(mediaFormat); > oms = new OpalVideoMediaStream(*this, mediaFormat, sessionID, pvid, NULL, > false); > } > > } > else > { > cout << "Request for stream skipped." << endl; > } > > return oms; > } > > |