612 iDelayFileEndingPos = 0; |
612 iDelayFileEndingPos = 0; |
613 iClipEnded = ETrue; |
613 iClipEnded = ETrue; |
614 |
614 |
615 iClipSessionObserver.EndOfClip(); |
615 iClipSessionObserver.EndOfClip(); |
616 } |
616 } |
|
617 else if ( IsRewindFromEnd() ) |
|
618 { |
|
619 TRAP_IGNORE( iClipSessionObserver.RewindFromEndL() ); |
|
620 } |
|
621 |
617 else |
622 else |
618 { |
623 { |
619 // Cannot handle, forward to the ancestor class |
624 // Cannot handle, forward to the ancestor class |
620 CMusEngMceSession::StreamStateChanged( aStream, aSource ); |
625 CMusEngMceSession::StreamStateChanged( aStream, aSource ); |
621 } |
626 } |
1056 |
1061 |
1057 CleanupStack::PopAndDestroy( fileMan ); |
1062 CleanupStack::PopAndDestroy( fileMan ); |
1058 CleanupStack::PopAndDestroy(); // fs |
1063 CleanupStack::PopAndDestroy(); // fs |
1059 } |
1064 } |
1060 |
1065 |
|
1066 // ----------------------------------------------------------------------------- |
|
1067 // |
|
1068 // ----------------------------------------------------------------------------- |
|
1069 // |
|
1070 TBool CMusEngClipSession::IsRewindFromEnd() |
|
1071 { |
|
1072 MUS_LOG( "mus: [ENGINE] -> CMusEngClipSession::IsRewindFromEnd()" ) |
|
1073 |
|
1074 TBool isRewindFromEnd = EFalse; |
|
1075 |
|
1076 if ( iSession ) |
|
1077 { |
|
1078 |
|
1079 CMceVideoStream* videoOut = NULL; |
|
1080 |
|
1081 TRAPD( error, |
|
1082 videoOut = MusEngMceUtils::GetVideoOutStreamL( *iSession ) ); |
|
1083 if( error != KErrNone ) |
|
1084 { |
|
1085 MUS_LOG1( "mus: [ENGINE] Error in GetVideoOutStreamL #%d", error ) |
|
1086 return isRewindFromEnd; |
|
1087 } |
|
1088 |
|
1089 CMceFileSource* filesource = NULL; |
|
1090 TRAP( error, filesource = MusEngMceUtils::GetFileSourceL( *iSession ) ) |
|
1091 |
|
1092 if ( error == KErrNone ) |
|
1093 { |
|
1094 TTimeIntervalMicroSeconds position; |
|
1095 TTimeIntervalMicroSeconds duration; |
|
1096 TRAP( error, position = filesource->PositionL() ); |
|
1097 TRAPD( error1, duration = filesource->DurationL() ); |
|
1098 if ( error != KErrNone || error1 != KErrNone ) |
|
1099 { |
|
1100 return isRewindFromEnd; |
|
1101 } |
|
1102 |
|
1103 MUS_LOG2( "mus: [ENGINE] position = %Ld, duration = %Ld", |
|
1104 position.Int64(), |
|
1105 duration.Int64() ) |
|
1106 |
|
1107 TRAP( error, isRewindFromEnd = |
|
1108 ( position.Int64() != 0 && |
|
1109 !filesource->IsEnabled() && |
|
1110 videoOut->State() == CMceMediaStream::EDisabled ) ) |
|
1111 if( isRewindFromEnd ) |
|
1112 { |
|
1113 MUS_LOG( "mus: [ENGINE] Rewind from end of clip" ) |
|
1114 } |
|
1115 } |
|
1116 } |
|
1117 |
|
1118 MUS_LOG( "mus: [ENGINE] <- CMusEngClipSession::IsRewindFromEnd()" ) |
|
1119 return isRewindFromEnd; |
|
1120 } |
1061 // End of file |
1121 // End of file |
1062 |
1122 |