23 #include <accpolhdmispeakerallocation.h> |
23 #include <accpolhdmispeakerallocation.h> |
24 #include <e32cmn.h> |
24 #include <e32cmn.h> |
25 #include <e32math.h> |
25 #include <e32math.h> |
26 #include <accessoriescrkeys.h> |
26 #include <accessoriescrkeys.h> |
27 #include <centralrepository.h> |
27 #include <centralrepository.h> |
28 #include <sysutil.h> |
|
29 |
28 |
30 #include "pdeconstants.h" |
29 #include "pdeconstants.h" |
31 #include "tvoutconfigforhdmi.h" |
30 #include "tvoutconfigforhdmi.h" |
32 #include "edidhandler.h" |
31 #include "edidhandler.h" |
33 #include "edidparserbase.h" |
32 #include "edidparserbase.h" |
191 CAccPolHdmiSink* hdmiSink( NULL ); |
190 CAccPolHdmiSink* hdmiSink( NULL ); |
192 if( iExtensionParserPtr && iTVOutConfigForHDMI.GetTvOutConfig() ) |
191 if( iExtensionParserPtr && iTVOutConfigForHDMI.GetTvOutConfig() ) |
193 { |
192 { |
194 hdmiSink = CAccPolHdmiSink::NewL( |
193 hdmiSink = CAccPolHdmiSink::NewL( |
195 iExtensionParserPtr->BasicAudio(), |
194 iExtensionParserPtr->BasicAudio(), |
196 ETrue ); |
195 iTVOutConfigForHDMI.GetTvOutConfig()->CopyProtectionStatus() ); |
197 } |
196 } |
198 else |
197 else |
199 { |
198 { |
200 User::Leave( KErrNotFound ); |
199 User::Leave( KErrNotFound ); |
201 } |
200 } |
635 //------------------------------------------------------------------------------ |
634 //------------------------------------------------------------------------------ |
636 // From class CActive. |
635 // From class CActive. |
637 // RunL |
636 // RunL |
638 //------------------------------------------------------------------------------ |
637 //------------------------------------------------------------------------------ |
639 // |
638 // |
640 TInt CEDIDHandler::RunError( TInt /*aError*/ ) |
639 TInt CEDIDHandler::RunError( TInt aError ) |
641 { |
640 { |
642 FUNC_LOG; |
641 FUNC_LOG; |
643 |
642 |
644 /*TInt err( aError ); |
643 /*TInt err( aError ); |
645 // Avoid Panic in CActiveScheduler |
644 // Avoid Panic in CActiveScheduler |
769 aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion(); |
768 aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion(); |
770 aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision(); |
769 aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision(); |
771 } |
770 } |
772 Mem::FillZ( ( TAny* )&aTimings.iProductName, ( sizeof( TChar ) * KProductNameChars ) ); |
771 Mem::FillZ( ( TAny* )&aTimings.iProductName, ( sizeof( TChar ) * KProductNameChars ) ); |
773 Mem::FillZ( ( TAny* )&aTimings.iProductDescription, ( sizeof( TChar ) * KProductDescriptorsChars ) ); |
772 Mem::FillZ( ( TAny* )&aTimings.iProductDescription, ( sizeof( TChar ) * KProductDescriptorsChars ) ); |
774 |
773 aTimings.iSourceType = THdmiDviTimings::ESourceTypeUnknown; |
775 TInt err = KErrNone; |
|
776 CDeviceTypeInformation* deviceTypeInfo = NULL; |
|
777 TRAP(err, deviceTypeInfo = SysUtil::GetDeviceTypeInfoL()); |
|
778 |
|
779 if(KErrNone == err) |
|
780 { |
|
781 #define MAX(a, b) (((a)>(b)) ? (a) : (b)) |
|
782 #define MIN(a, b) (((a)<(b)) ? (a) : (b)) |
|
783 |
|
784 TPtrC16 bufPtrModelCode; |
|
785 TPtrC16 bufPtrManufacturerName; |
|
786 TUint loopCount; |
|
787 TUint maxLen; |
|
788 TUint maxCharsLen; |
|
789 TUint minNameCharsLen; |
|
790 TUint minDescritopCharsLen; |
|
791 |
|
792 deviceTypeInfo->GetManufacturerName(bufPtrManufacturerName); |
|
793 deviceTypeInfo->GetModelCode(bufPtrModelCode); |
|
794 maxLen = MAX(bufPtrModelCode.Length(),bufPtrManufacturerName.Length()); |
|
795 maxCharsLen = MAX(KProductNameChars,KProductDescriptorsChars); |
|
796 minNameCharsLen = MIN(KProductNameChars, bufPtrModelCode.Length()); |
|
797 minDescritopCharsLen = MIN(KProductDescriptorsChars, bufPtrManufacturerName.Length()); |
|
798 |
|
799 INFO_1( "maxLen : %d", maxLen); |
|
800 INFO_1( "maxCharsLen : %d", maxCharsLen); |
|
801 INFO_1( "minNameCharsLen : %d", minNameCharsLen); |
|
802 INFO_1( "minDescritopCharsLen : %d", minDescritopCharsLen); |
|
803 |
|
804 for(loopCount = 0; loopCount < maxLen; loopCount++) |
|
805 { |
|
806 if(loopCount >= maxCharsLen) |
|
807 { |
|
808 break; |
|
809 } |
|
810 else |
|
811 { |
|
812 if(loopCount < minNameCharsLen) |
|
813 { |
|
814 aTimings.iProductName[loopCount] = bufPtrModelCode[loopCount]; |
|
815 INFO_1( "aTimings.iProductName : %d", aTimings.iProductName[loopCount].GetLowerCase()); |
|
816 } |
|
817 if(loopCount < minDescritopCharsLen) |
|
818 { |
|
819 aTimings.iProductDescription[loopCount] = bufPtrManufacturerName[loopCount]; |
|
820 INFO_1( "aTimings.iProductDescription : %d", aTimings.iProductDescription[loopCount].GetLowerCase()); |
|
821 } |
|
822 } |
|
823 } |
|
824 INFO("Before Deleting Pointer deviceTypeInfo"); |
|
825 delete deviceTypeInfo; |
|
826 INFO("After Deleting Pointer deviceTypeInfo"); |
|
827 aTimings.iSourceType = THdmiDviTimings::ESourceTypePCGeneral; |
|
828 } |
|
829 else |
|
830 { |
|
831 aTimings.iSourceType = THdmiDviTimings::ESourceTypeUnknown; |
|
832 } |
|
833 } |
774 } |
834 |
775 |
835 //------------------------------------------------------------------------------ |
776 //------------------------------------------------------------------------------ |
836 // CEDIDHandler::FillHdmiDviTimings |
777 // CEDIDHandler::FillHdmiDviTimings |
837 //------------------------------------------------------------------------------ |
778 //------------------------------------------------------------------------------ |