dvrengine/CommonRecordingEngine/src/CCRPacketSourceBase.cpp
branchRCL_3
changeset 23 13a33d82ad98
parent 0 822a42b6c3f1
equal deleted inserted replaced
22:826cea16efd9 23:13a33d82ad98
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Base class for all packet sources*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDES
       
    21 #include "CCRPacketSourceBase.h"
       
    22 #include "CCRPacketBuffer.h"
       
    23 #include "videoserviceutilsLogger.h"
       
    24 
       
    25 // CONSTANTS
       
    26 // None
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CCRPacketSourceBase::CCRPacketSourceBase
       
    32 // C++ default constructor can NOT contain any code, that might leave.
       
    33 // -----------------------------------------------------------------------------
       
    34 //  
       
    35 CCRPacketSourceBase::CCRPacketSourceBase(
       
    36     CCRStreamingSession& aSession,
       
    37     CCRStreamingSession::TCRSourceId aSourceId )
       
    38   : iOwningSession( aSession ),
       
    39     iSourceId( aSourceId )
       
    40     {
       
    41     // None
       
    42     }
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CCRPacketSourceBase::CCRPacketSourceBase
       
    46 // Destructor.
       
    47 // -----------------------------------------------------------------------------
       
    48 //
       
    49 CCRPacketSourceBase::~CCRPacketSourceBase()
       
    50     {    
       
    51     iBuffer = NULL; // Does not delete and it is right thing.   
       
    52     }
       
    53 
       
    54 // -----------------------------------------------------------------------------
       
    55 // CCRPacketSourceBase::SetBuffer
       
    56 //
       
    57 // -----------------------------------------------------------------------------
       
    58 //      
       
    59 void CCRPacketSourceBase::SetBuffer( CCRPacketBuffer* aBuffer )
       
    60     {
       
    61     iBuffer = aBuffer;
       
    62     // By default variables are set for continous streaming
       
    63     iBuffer->ContinousStream( ETrue );
       
    64     iBuffer->MoreComing( ETrue );
       
    65     }
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // CCRPacketSourceBase::SeqAndTS
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 TInt CCRPacketSourceBase::SeqAndTS(
       
    72     TUint& /*aAudioSeq*/,
       
    73     TUint& /*aAudioTS*/,
       
    74     TUint& /*aVideoSeq*/,
       
    75     TUint& /*aVideoTS*/ )
       
    76     {
       
    77     return KErrNotReady;
       
    78     }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CCRPacketSourceBase::Id
       
    82 // 
       
    83 // -----------------------------------------------------------------------------
       
    84 //  
       
    85 CCRStreamingSession::TCRSourceId CCRPacketSourceBase::Id( void ) const
       
    86     {
       
    87     return iSourceId; 
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CCRPacketSourceBase::RegisterConnectionObs
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 void CCRPacketSourceBase::RegisterConnectionObs(
       
    95     MCRConnectionObserver* /*aObserver*/ )
       
    96     {
       
    97     // None
       
    98     }
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CCRPacketSourceBase::Play
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 TInt CCRPacketSourceBase::Play(
       
   105     const TReal& /*aStartPos*/,
       
   106     const TReal& /*aEndPos*/ )
       
   107     {
       
   108     LOG( "CCRPacketSourceBase::Play(), KErrCompletion !" );
       
   109 
       
   110     return KErrCompletion;
       
   111     }
       
   112 
       
   113 // -----------------------------------------------------------------------------
       
   114 // CCRPacketSourceBase::Pause
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 TInt CCRPacketSourceBase::Pause()
       
   118     {
       
   119     LOG( "CCRPacketSourceBase::Pause(), KErrCompletion !" );
       
   120 
       
   121     return KErrCompletion;
       
   122     }
       
   123 
       
   124 // -----------------------------------------------------------------------------
       
   125 // CCRPacketSourceBase::Stop
       
   126 // -----------------------------------------------------------------------------
       
   127 //
       
   128 TInt CCRPacketSourceBase::Stop()
       
   129     {
       
   130     LOG( "CCRPacketSourceBase::Stop(), KErrCompletion" );
       
   131     
       
   132     return KErrCompletion;
       
   133     }
       
   134 
       
   135 // -----------------------------------------------------------------------------
       
   136 // CCRPacketSourceBase::SetPosition
       
   137 //
       
   138 // -----------------------------------------------------------------------------
       
   139 //      
       
   140 TInt CCRPacketSourceBase::SetPosition( const TInt64 /*aPosition*/ )
       
   141     {
       
   142     LOG( "CCRPacketSourceBase::SetPosition(), KErrCompletion !" );
       
   143 
       
   144     return KErrCompletion;
       
   145     }
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CCRPacketSourceBase::GetPosition
       
   149 //
       
   150 // -----------------------------------------------------------------------------
       
   151 //      
       
   152 TInt CCRPacketSourceBase::GetPosition( TInt64& aPosition, TInt64& aDuration )
       
   153     {
       
   154     LOG( "CCRPacketSourceBase::GetPosition(), KErrCompletion !" );
       
   155 
       
   156     aPosition = 0;
       
   157     aDuration = 0;
       
   158     return KErrCompletion;
       
   159     }
       
   160 
       
   161 // -----------------------------------------------------------------------------
       
   162 // CCRPacketSourceBase::GetRange
       
   163 // -----------------------------------------------------------------------------
       
   164 //
       
   165 void CCRPacketSourceBase::GetRange( TReal& aLower, TReal& aUpper )
       
   166     {
       
   167     aLower = KRealZero;
       
   168     aUpper = KRealMinusOne;
       
   169     }
       
   170 
       
   171 // -----------------------------------------------------------------------------
       
   172 // CCRPacketSourceBase::PostActionL
       
   173 // -----------------------------------------------------------------------------
       
   174 //
       
   175 void CCRPacketSourceBase::PostActionL()
       
   176     {
       
   177     LOG( "CCRPacketSourceBase::PostActionL(), Leaves KErrCompletion !" );
       
   178 
       
   179     User::Leave( KErrCompletion );
       
   180     }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CCRPacketSourceBase::Restore
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 void CCRPacketSourceBase::Restore()
       
   187     {
       
   188     // None
       
   189     }
       
   190 
       
   191 //  End of File