multimediacommsengine/mmcesrv/mmcemediamanager/src/mcemediamanager.cpp
branchRCL_3
changeset 3 513a8b745b2f
parent 0 1bce908db942
child 18 91f50911ea81
child 49 64c62431ac08
equal deleted inserted replaced
0:1bce908db942 3:513a8b745b2f
  4778             }
  4778             }
  4779         }
  4779         }
  4780         
  4780         
  4781     MCEMM_DEBUG("CMceMediaManager::DoConfigKeyUpdateL(), Exit ");
  4781     MCEMM_DEBUG("CMceMediaManager::DoConfigKeyUpdateL(), Exit ");
  4782     }
  4782     }
       
  4783 // ---------------------------------------------------------
       
  4784 // CMceMediaManager::UpDateStreamStateL
       
  4785 // ---------------------------------------------------------    
       
  4786 //
       
  4787 void CMceMediaManager::UpDateStreamStateL(CMceComSession& currentSession,
       
  4788 		                    CMceComSession& forkSession )
       
  4789 	{
       
  4790 	MCEMM_DEBUG("CMceMediaManager::UpDateStreamState, Entry ");
       
  4791 	CMceSrvStream* stream = NULL;
       
  4792 	RPointerArray<CMceSrvStream> currentStreams;
       
  4793 	TMceSrvStreamIterator sendStreams( currentSession.MccStreams(), 
       
  4794 			                            TMceSrvStreamIterator::ESend );
       
  4795 	while( sendStreams.Next( stream, CMceSrvStream::EStopped, 
       
  4796 		                           TMceSrvStreamIterator::ExactReverseMatch ) )	                                     
       
  4797 		{
       
  4798 		if ( stream->State() != CMceSrvStream::EInactive &&
       
  4799 				 stream->Codec().iIsNegotiated )
       
  4800 			{ 
       
  4801 			currentStreams.Append( stream );
       
  4802 			}
       
  4803 		}
       
  4804 	TMceSrvStreamIterator forkSendStreams( forkSession.MccStreams(), 
       
  4805 			                                 TMceSrvStreamIterator::ESend );
       
  4806 	while( forkSendStreams.Next( stream, CMceSrvStream::EStopped, 
       
  4807 	                             TMceSrvStreamIterator::ExactReverseMatch ) )                                     
       
  4808 		{
       
  4809 		if ( stream->State() != CMceSrvStream::EInactive &&
       
  4810 				stream->Codec().iIsNegotiated )
       
  4811 			{ 
       
  4812 			CMccCodecInformation* codec = 
       
  4813 			                      iMccInterface->CodecL( stream->SessionId(),
       
  4814 	                    		                         stream->LinkId(),
       
  4815 	                    		                         stream->Id() );
       
  4816 			CleanupStack::PushL( codec );
       
  4817 			stream->Codec().MccPopulateL( *codec, *stream, EMceRoleOfferer );
       
  4818 			User::LeaveIfError( iMccInterface->SetCodec( stream->SessionId(),
       
  4819 	                    		  stream->LinkId(), stream->Id(), *codec ) );
       
  4820 			CleanupStack::PopAndDestroy( codec );
       
  4821 			TBool IsMatch = EFalse;
       
  4822 			for( TInt count = 0; count < currentStreams.Count() && !IsMatch; count++ )
       
  4823 				{
       
  4824 				if( currentStreams[count]->Codec().iSdpName ==  
       
  4825 				                           stream->Codec().iSdpName )
       
  4826 					{
       
  4827 					IsMatch = ETrue;
       
  4828 					}
       
  4829 				}
       
  4830 			if( !IsMatch )
       
  4831 				{
       
  4832 				SetPendingState( *stream, 0, CMceSrvStream::EPaused );
       
  4833 				} 	
       
  4834 			}
       
  4835 		}
       
  4836 	MCEMM_DEBUG("CMceMediaManager::UpDateStreamState, Exit ");
       
  4837 	}
       
  4838 // ---------------------------------------------------------
       
  4839 // CMceMediaManager::ForceEnableSinkState
       
  4840 // ---------------------------------------------------------    
       
  4841 //
       
  4842 void CMceMediaManager::ForceEnableSinkState(CMceComSession& aSession )
       
  4843 	{
       
  4844 	CMceSrvStream* stream = NULL;
       
  4845 	TBool IsSet = EFalse;
       
  4846 	TMceSrvStreamIterator sendStreams( aSession.MccStreams(), TMceSrvStreamIterator::ESend );
       
  4847 	while( !IsSet && sendStreams.Next( stream, CMceSrvStream::EStopped, 
       
  4848 			                             TMceSrvStreamIterator::ExactReverseMatch ) )	                                     
       
  4849 		{
       
  4850 		if ( stream->State() != CMceSrvStream::EInactive &&
       
  4851 			             stream->Codec().iIsNegotiated )
       
  4852 			{ 
       
  4853 			SetPendingState( *stream, stream->Sink().Id(), CMceSrvStream::EPaused );
       
  4854 			IsSet = ETrue;
       
  4855 			}
       
  4856 		}
       
  4857 	}
  4783         
  4858         
  4784 // End of File
  4859 // End of File