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> |
28 |
29 |
29 #include "pdeconstants.h" |
30 #include "pdeconstants.h" |
30 #include "tvoutconfigforhdmi.h" |
31 #include "tvoutconfigforhdmi.h" |
31 #include "edidhandler.h" |
32 #include "edidhandler.h" |
32 #include "edidparserbase.h" |
33 #include "edidparserbase.h" |
190 CAccPolHdmiSink* hdmiSink( NULL ); |
191 CAccPolHdmiSink* hdmiSink( NULL ); |
191 if( iExtensionParserPtr && iTVOutConfigForHDMI.GetTvOutConfig() ) |
192 if( iExtensionParserPtr && iTVOutConfigForHDMI.GetTvOutConfig() ) |
192 { |
193 { |
193 hdmiSink = CAccPolHdmiSink::NewL( |
194 hdmiSink = CAccPolHdmiSink::NewL( |
194 iExtensionParserPtr->BasicAudio(), |
195 iExtensionParserPtr->BasicAudio(), |
195 iTVOutConfigForHDMI.GetTvOutConfig()->CopyProtectionStatus() ); |
196 ETrue ); |
196 } |
197 } |
197 else |
198 else |
198 { |
199 { |
199 User::Leave( KErrNotFound ); |
200 User::Leave( KErrNotFound ); |
200 } |
201 } |
634 //------------------------------------------------------------------------------ |
635 //------------------------------------------------------------------------------ |
635 // From class CActive. |
636 // From class CActive. |
636 // RunL |
637 // RunL |
637 //------------------------------------------------------------------------------ |
638 //------------------------------------------------------------------------------ |
638 // |
639 // |
639 TInt CEDIDHandler::RunError( TInt aError ) |
640 TInt CEDIDHandler::RunError( TInt /*aError*/ ) |
640 { |
641 { |
641 FUNC_LOG; |
642 FUNC_LOG; |
642 |
643 |
643 /*TInt err( aError ); |
644 /*TInt err( aError ); |
644 // Avoid Panic in CActiveScheduler |
645 // Avoid Panic in CActiveScheduler |
768 aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion(); |
769 aTimings.iTvHdmiVersion = iEdidParserPtr->GetVersion(); |
769 aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision(); |
770 aTimings.iTvHdmiRevision = iEdidParserPtr->GetRevision(); |
770 } |
771 } |
771 Mem::FillZ( ( TAny* )&aTimings.iProductName, ( sizeof( TChar ) * KProductNameChars ) ); |
772 Mem::FillZ( ( TAny* )&aTimings.iProductName, ( sizeof( TChar ) * KProductNameChars ) ); |
772 Mem::FillZ( ( TAny* )&aTimings.iProductDescription, ( sizeof( TChar ) * KProductDescriptorsChars ) ); |
773 Mem::FillZ( ( TAny* )&aTimings.iProductDescription, ( sizeof( TChar ) * KProductDescriptorsChars ) ); |
773 aTimings.iSourceType = THdmiDviTimings::ESourceTypeUnknown; |
774 |
|
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 } |
774 } |
833 } |
775 |
834 |
776 //------------------------------------------------------------------------------ |
835 //------------------------------------------------------------------------------ |
777 // CEDIDHandler::FillHdmiDviTimings |
836 // CEDIDHandler::FillHdmiDviTimings |
778 //------------------------------------------------------------------------------ |
837 //------------------------------------------------------------------------------ |