vtprotocols/src/cdatasinkproxy.cpp
branchRCL_3
changeset 40 7fb4a99d4b6b
parent 0 ed9695c8bcbe
child 49 8e703580edd3
equal deleted inserted replaced
37:590f6f022902 40:7fb4a99d4b6b
    58 CPVDisplaySinkNodeProxy::CPVDisplaySinkNodeProxy() : MVTVideoSource(KNullUid) 
    58 CPVDisplaySinkNodeProxy::CPVDisplaySinkNodeProxy() : MVTVideoSource(KNullUid) 
    59     {
    59     {
    60     }
    60     }
    61 
    61 
    62 // -----------------------------------------------------------------------------
    62 // -----------------------------------------------------------------------------
       
    63 // CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy
       
    64 // destructor.add for memory leak
       
    65 // -----------------------------------------------------------------------------
       
    66 //
       
    67 CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy()
       
    68     {
       
    69     __IF_DEBUG(Print( _L( "VTProto: CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy<" ) ));
       
    70     __IF_DEBUG(Print( _L( "VTProto: ~CPVDisplaySinkNodeProxy = %x"), (TInt)this) );
       
    71     __IF_DEBUG(Print( _L( "VTProto: CPVDisplaySinkNodeProxy::~CPVDisplaySinkNodeProxy>" ) ));
       
    72     }
       
    73 
       
    74 // ============================ CVSVideoOutput =================================
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CVSVideoOutput::CVSVideoOutput
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 CVSVideoOutput::CVSVideoOutput( CDisplaySinkProxy* aSink )
       
    81 : iSink( aSink )
       
    82     {
       
    83     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::CVSVideoOutput()<"), RThread().Id().operator TUint()));
       
    84     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::CVSVideoOutput()>"), RThread().Id().operator TUint()));
       
    85     }
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CVSVideoOutput::SetFormatL
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 void CVSVideoOutput::SetFormatL( const TDesC8& aFormat )
       
    92     {
       
    93     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetFormatL()<"), RThread().Id().operator TUint()));
       
    94     iSink->SetFormatL( aFormat );
       
    95     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetFormatL()>"), RThread().Id().operator TUint()));
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // CVSVideoOutput::SetVideoFrameSizeL
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 void CVSVideoOutput::SetVideoFrameSizeL( const TSize& aSize )
       
   103     {
       
   104     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetVideoFrameSizeL()<"), RThread().Id().operator TUint()));
       
   105     iSink->SetVideoFrameSizeL( aSize );
       
   106     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::SetVideoFrameSizeL()>"), RThread().Id().operator TUint()));
       
   107     }
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CVSVideoOutput::GetVideoFrameSizeL
       
   111 // -----------------------------------------------------------------------------
       
   112 //
       
   113 void CVSVideoOutput::GetVideoFrameSizeL( TSize& aSize ) const
       
   114     {
       
   115     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::GetVideoFrameSizeL()<"), RThread().Id().operator TUint()));
       
   116     iSink->GetVideoFrameSizeL( aSize );
       
   117     __IF_DEBUG(Print(_L("VideoSource[%d]: CVSVideoOutput::GetVideoFrameSizeL()>"), RThread().Id().operator TUint()));
       
   118     }
       
   119 
       
   120 // -----------------------------------------------------------------------------
    63 // CDisplaySinkProxy::CDisplaySinkProxy
   121 // CDisplaySinkProxy::CDisplaySinkProxy
    64 // Constructor.
   122 // Constructor.
    65 // -----------------------------------------------------------------------------
   123 // -----------------------------------------------------------------------------
    66 //
   124 //
    67 CDisplaySinkProxy::CDisplaySinkProxy(MVTVideoSink* aDisplaySink) : MPVDataSink(KNullUid), iDisplaySink(aDisplaySink) 
   125 CDisplaySinkProxy::CDisplaySinkProxy(MVTVideoSink* aDisplaySink) : MPVDataSink(KNullUid), iDisplaySink(aDisplaySink) 
    69     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::CDisplaySinkProxy<" ) ));
   127     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::CDisplaySinkProxy<" ) ));
    70     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::CDisplaySinkProxy iDisplaySink %d>" ), iDisplaySink));
   128     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::CDisplaySinkProxy iDisplaySink %d>" ), iDisplaySink));
    71     }
   129     }
    72 
   130 
    73 // -----------------------------------------------------------------------------
   131 // -----------------------------------------------------------------------------
       
   132 // CDisplaySinkProxy::~CDisplaySinkProxy
       
   133 // destructor.add for memory leak
       
   134 // -----------------------------------------------------------------------------
       
   135 //
       
   136 CDisplaySinkProxy::~CDisplaySinkProxy()
       
   137     {
       
   138     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::~CDisplaySinkProxy<" ) ));
       
   139     __IF_DEBUG(Print( _L( "VTProto: ~CDisplaySinkProxy = %x"), (TInt)this) );
       
   140     delete iVideoOutputInterface;
       
   141     delete iDSNodeProxy;
       
   142     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::~CDisplaySinkProxy>" ) ));
       
   143     }
       
   144 // -----------------------------------------------------------------------------
    74 // CDisplaySinkProxy::ConstructL
   145 // CDisplaySinkProxy::ConstructL
    75 // -----------------------------------------------------------------------------
   146 // -----------------------------------------------------------------------------
    76 //
   147 //
    77 void CDisplaySinkProxy::ConstructL()
   148 void CDisplaySinkProxy::ConstructL()
    78     {
   149     {
    79     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL<" ) ));
   150     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL<" ) ));
    80     iDSNodeProxy = new (ELeave)CPVDisplaySinkNodeProxy();
   151     iDSNodeProxy = new (ELeave)CPVDisplaySinkNodeProxy();
       
   152     iVideoOutputInterface = new (ELeave) CVSVideoOutput( this );
    81     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL>" ) ));
   153     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::ConstructL>" ) ));
    82     }
   154     }
    83 
   155 
    84 
   156 
    85 // -----------------------------------------------------------------------------
   157 // -----------------------------------------------------------------------------
   105 void CDisplaySinkProxy::QueryInterface( const TPVUuid& aUuid, TPVInterfacePtr& aInterfacePtr )
   177 void CDisplaySinkProxy::QueryInterface( const TPVUuid& aUuid, TPVInterfacePtr& aInterfacePtr )
   106     {
   178     {
   107     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface<" ) ));
   179     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface<" ) ));
   108     if ( aUuid == KPVUidVideoOutputInterface )
   180     if ( aUuid == KPVUidVideoOutputInterface )
   109         {
   181         {
   110         MPVVideoInput* interfaceP = (MPVVideoInput*) this;
   182         MPVVideoInput* interfaceP = (MPVVideoInput*) iVideoOutputInterface;
   111         aInterfacePtr = (TPVInterfacePtr) interfaceP;
   183         aInterfacePtr = (TPVInterfacePtr) interfaceP;
   112         }
   184         }
   113     else
   185     else
   114         {
   186         {
   115         aInterfacePtr = NULL;
   187         aInterfacePtr = NULL;
   116         }
   188         }
   117     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface aInterfacePtr %d>" ), aInterfacePtr ));  
   189     __IF_DEBUG(Print( _L( "VTProto: CDisplaySinkProxy::QueryInterface aInterfacePtr %x>" ), aInterfacePtr ));  
   118     }
   190     }
   119 
   191 
   120 // -----------------------------------------------------------------------------
   192 // -----------------------------------------------------------------------------
   121 // CDisplaySinkProxy::GetMultimediaTypesL
   193 // CDisplaySinkProxy::GetMultimediaTypesL
   122 // This API returns multimedias type supported by the data source/sink.
   194 // This API returns multimedias type supported by the data source/sink.