Revision: 201010 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 23:34:12 +0300
branchRCL_3
changeset 6 9ebf3284bc56
parent 4 3993b8f65362
child 7 e5ca06a707ac
Revision: 201010 Kit: 201013
imagingmodules/jp2kcodec/Src/JP2KCodec.cpp
imagingmodules/jp2kcodec/Src/JP2KImageData.cpp
package_definition.xml
--- a/imagingmodules/jp2kcodec/Src/JP2KCodec.cpp	Sat Feb 20 00:07:53 2010 +0200
+++ b/imagingmodules/jp2kcodec/Src/JP2KCodec.cpp	Wed Mar 31 23:34:12 2010 +0300
@@ -271,7 +271,7 @@
         jp2kComment->iComment = mainMarker.iCom[index]->iCcom;
 
         User::LeaveIfError( iFrameData->AppendImageData( jp2kComment ) );
-        CleanupStack::Pop();
+        CleanupStack::Pop(jp2kComment);
 
         // Transfer the ownership of the buffer from TMainMarker to framework
         User::LeaveIfError( iFrameData->AppendImageBuffer( jp2kComment->iComment ) );
@@ -841,8 +841,7 @@
         {
         // COD in Tile Part Header
         codMarker = new ( ELeave ) TCODMarker;        
-        //CleanupDeletePushL( codMarker );
-        CleanupStack::PushL(codMarker);
+        CleanupDeletePushL( codMarker );
         }
 
     codMarker->iScod = *iReader.iPtr++;
@@ -864,7 +863,6 @@
         {
         // Entropy coder with precincts defined below
         codMarker->iPrecinctSiz = HBufC8::NewL( codMarker->iNumOfLevels + 1 );
-        CleanupStack::PushL(codMarker->iPrecinctSiz);
         for ( TUint8 index = 0; index < codMarker->iNumOfLevels + 1; ++index )
             {
             codMarker->iPrecinctSiz->Des().Append( *iReader.iPtr++ );
@@ -877,17 +875,14 @@
         // We must be missing some data in the marker
         User::Leave( KErrCorrupt );
         }
-    if ( codMarker->iScod & 0x01 )
-        {
-            CleanupStack::Pop(codMarker->iPrecinctSiz);
-        }
+
     if ( !aMain )
         {
         CJ2kTileInfo& tile = CONST_CAST( CJ2kTileInfo&, iImageInfo->TileAt( iLastTileIndex ) );
 
         // Append COD to the current tile and decrement the tile length
         tile.AppendCOD( codMarker, markerLength + KMarkerSize );
-        CleanupStack::PopAndDestroy(codMarker);
+        CleanupStack::Pop(codMarker);
         }
 
     // Any valid marker may come after COD marker
@@ -927,8 +922,7 @@
     const TSizMarker& sizMarker = iImageInfo->SizMarker();
 
     TCOCMarker *cocMarker = new ( ELeave ) TCOCMarker;    
-    //CleanupDeletePushL(cocMarker);
-    CleanupStack::PushL(cocMarker);
+    CleanupDeletePushL(cocMarker);
 
     if ( sizMarker.iCsiz < 257 )
         {
@@ -957,7 +951,6 @@
         {
         // Entropy coder with precincts defined below
         cocMarker->iPrecinctSiz = HBufC8::NewL( cocMarker->iNumOfLevels + 1 );
-        CleanupStack::PushL(cocMarker->iPrecinctSiz);
         for ( TUint8 index = 0; index < cocMarker->iNumOfLevels + 1; ++index )
             {
             cocMarker->iPrecinctSiz->Des().Append( *iReader.iPtr++ );
@@ -982,12 +975,7 @@
         // Append COC to the current tile and decrement the tile length
         tile.AppendCOCL( cocMarker, markerLength + KMarkerSize );
         }
-    
-    if ( cocMarker->iScoc & 0x01 )
-        {    
-            CleanupStack::Pop(cocMarker->iPrecinctSiz);
-        }
-    CleanupStack::PopAndDestroy(cocMarker);
+    CleanupStack::Pop(cocMarker);
 
     // Any valid marker may come after COC marker
     iFHState = EStateInUnknown;
@@ -1035,8 +1023,7 @@
         // QCD in Tile Part Header
         qcdMarker = new ( ELeave ) TQCDMarker;
         
-        //CleanupDeletePushL( qcdMarker );
-        CleanupStack::PushL( qcdMarker );
+        CleanupDeletePushL( qcdMarker );
         }
 
     qcdMarker->iSqcd = *iReader.iPtr++;
@@ -1079,12 +1066,6 @@
                 }
             }
         }
-    
-    CleanupStack::PushL( qcdMarker->iExponent );
-    if ((qcdMarker->iSqcd & 0x1f) || (qcdMarker->iSqcd & 0x01))
-    {
-        CleanupStack::PushL( qcdMarker->iMantissa );       
-    }
 
     // Make sure we read all the data
     if ( ( iReader.iPtr - iReader.iPtrStartMarker ) != ( markerLength + KMarkerSize ) )
@@ -1093,22 +1074,13 @@
         User::Leave( KErrCorrupt );
         }
 
-    
-    if ((qcdMarker->iSqcd & 0x1f) || (qcdMarker->iSqcd & 0x01))
-    {
-        CleanupStack::Pop( qcdMarker->iMantissa );       
-    }   
-    
-    CleanupStack::Pop( qcdMarker->iExponent );
-    
     if ( !aMain )
         {
         CJ2kTileInfo& tile = CONST_CAST( CJ2kTileInfo&, iImageInfo->TileAt( iLastTileIndex ) );
 
         // Append QCD to the current tile and decrement the tile length
         tile.AppendQCD( qcdMarker, markerLength + KMarkerSize );
-        //CleanupStack::PopAndDestroy(qcdMarker);
-        CleanupStack::PopAndDestroy(qcdMarker);
+        CleanupStack::Pop(qcdMarker);
         }
 
     // Any valid marker may come after QCD marker
@@ -1149,8 +1121,7 @@
 
     TQCCMarker *qccMarker = new (ELeave) TQCCMarker;
 
-    //CleanupDeletePushL( qccMarker );
-    CleanupStack::PushL( qccMarker );
+    CleanupDeletePushL( qccMarker );
 
     if ( sizMarker.iCsiz < 257 )
         {
@@ -1203,12 +1174,6 @@
                 }
             }
         }
-    
-    CleanupStack::PushL( qccMarker->iExponent );
-    if( (qccMarker->iSqcc & 0x1f) || (qccMarker->iSqcc & 0x01) )
-    {
-        CleanupStack::PushL( qccMarker->iMantissa );
-    }
 
     // Make sure we read all the data
     if ( ( iReader.iPtr - iReader.iPtrStartMarker ) != ( markerLength + KMarkerSize ) )
@@ -1228,14 +1193,7 @@
         // Append QCC to the current tile and decrement the tile length
         tile.AppendQCCL( qccMarker, markerLength + KMarkerSize );
         }
-    
-    if( (qccMarker->iSqcc & 0x1f) || (qccMarker->iSqcc & 0x01) )
-    {
-        CleanupStack::Pop( qccMarker->iMantissa );
-    }    
-    
-    CleanupStack::Pop( qccMarker->iExponent );
-    CleanupStack::PopAndDestroy(qccMarker);
+    CleanupStack::Pop(qccMarker);
 
     // Any valid marker may come after QCC marker
     iFHState = EStateInUnknown;
@@ -1275,7 +1233,7 @@
     const TSizMarker& sizMarker = iImageInfo->SizMarker();
 
     TRGNMarker *rgnMarker = new ( ELeave ) TRGNMarker;
-    CleanupStack::PushL( rgnMarker );
+    CleanupDeletePushL( rgnMarker );
 
     if ( sizMarker.iCsiz < 257 )
         {
@@ -1309,7 +1267,7 @@
         // Append RGN to the current tile and decrement the tile length
         tile.AppendRGNL( rgnMarker, markerLength + KMarkerSize );
         }
-    CleanupStack::PopAndDestroy(rgnMarker);
+    CleanupStack::Pop(rgnMarker);
 
     // Any valid marker may come after RGN marker
     iFHState = EStateInUnknown;
@@ -1402,7 +1360,7 @@
         // Append POC to the current tile and decrement the tile length
         tile.AppendPOCL( pocMarker, markerLength + KMarkerSize );
         }
-    CleanupStack::Pop(  );
+    CleanupStack::Pop(pocMarker);
 
     // Any valid marker may come after POC marker
     iFHState = EStateInUnknown;
@@ -1449,14 +1407,13 @@
             }
 
         TPPMMarker *ppmMarker = new ( ELeave ) TPPMMarker;        
-        CleanupStack::PushL( ppmMarker );
+        CleanupDeletePushL( ppmMarker );
 
         ppmMarker->iZppm = *iReader.iPtr++;
         TUint32 entries = (TUint32)( markerLength - KMarkerSize - 1 );
 
         ppmMarker->iNppm = entries;
         ppmMarker->iIppm = HBufC8::NewL( entries );
-        CleanupStack::PushL( ppmMarker->iIppm );
 
         if ( !isUnderflow )
             {
@@ -1502,7 +1459,6 @@
             {
             User::LeaveIfError( mainMarker.iPpm.Append( ppmMarker ) );
             }
-        CleanupStack::Pop(ppmMarker->iIppm);
         CleanupStack::Pop(ppmMarker);
         }
     else
@@ -1629,7 +1585,7 @@
         {
         User::LeaveIfError( mainMarker.iTlm.Append( tlmMarker ) );
         }
-    CleanupStack::Pop();
+    CleanupStack::Pop(tlmMarker);
 
     // Any valid marker may come after TLM marker
     iFHState = EStateInUnknown;
@@ -1666,14 +1622,13 @@
         }
 
     TPLMMarker *plmMarker =  new ( ELeave ) TPLMMarker;    
-    CleanupStack::PushL( plmMarker );
+    CleanupDeletePushL( plmMarker );
 
     plmMarker->iZplm = *iReader.iPtr++;
     TUint32 entries = (TUint32)( markerLength - KMarkerSize - 1 );
 
     plmMarker->iNplm = (TUint8)entries;
     plmMarker->iIplm = HBufC8::NewL( entries );
-    CleanupStack::PushL( plmMarker->iIplm );
     plmMarker->iIplm->Des().Append( iReader.iPtr, entries );
     iReader.iPtr += entries;
 
@@ -1707,8 +1662,7 @@
         {
         User::LeaveIfError( mainMarker.iPlm.Append( plmMarker ) );
         }
-    CleanupStack::Pop(plmMarker->iIplm);
-    CleanupStack::PopAndDestroy(plmMarker);
+    CleanupStack::Pop(plmMarker);
 
     // Any valid marker may come after PLM marker
     iFHState = EStateInUnknown;
@@ -1767,7 +1721,7 @@
 
     iImageInfo->AppendCRGL( crgMarker );
 
-    CleanupStack::Pop(  );
+    CleanupStack::Pop(crgMarker);
 
     // Any valid marker may come after CRG marker
     iFHState = EStateInUnknown;
@@ -1813,16 +1767,13 @@
             isUnderflow = ETrue;
             }
 
-        TCOMMarker* comMarker = new ( ELeave ) TCOMMarker;   
-        //CleanupDeletePushL(comMarker);
-        CleanupStack::PushL( comMarker );
+        TCOMMarker* comMarker = new ( ELeave ) TCOMMarker;        
+        CleanupDeletePushL( comMarker );
 
         comMarker->iRcom = PtrReadUtil::ReadBigEndianUint16Inc( iReader.iPtr );
         TInt entries = markerLength - ( 2 * KMarkerSize );
 
         comMarker->iCcom = HBufC8::NewL( entries );
-        //CleanupDeletePushL( comMarker->iCcom );
-        CleanupStack::PushL(comMarker->iCcom);
         if ( !isUnderflow )
             {
             comMarker->iCcom->Des().Append( iReader.iPtr, entries );
@@ -1855,7 +1806,6 @@
             // Append COM to the current tile and decrement the tile length
             tile.AppendCOML( comMarker, markerLength + KMarkerSize );
             }
-        CleanupStack::Pop(comMarker->iCcom);
         CleanupStack::Pop(comMarker);
         }
     else
@@ -1889,7 +1839,7 @@
         // Underflow, stay in the same state
         if ( aMain )
             {
-            iReader.UpdateMainHeader(  );
+            iReader.UpdateMainHeader();
             }
         return EFrameIncomplete;
         }
@@ -2030,7 +1980,7 @@
     if ( iUseNewTile )
         { 
         iImageInfo->Append( tile );
-        CleanupStack::Pop();
+        CleanupStack::Pop(tile);
         iUseNewTile = EFalse;
         }
 
@@ -2352,12 +2302,11 @@
         }
 
     TPPTMarker *pptMarker = new ( ELeave ) TPPTMarker;    
-    CleanupStack::PushL( pptMarker );
+    CleanupDeletePushL(pptMarker);
 
     TInt entries = markerLength - KMarkerSize - 1;
     pptMarker->iZppt = *iReader.iPtr++;
     pptMarker->iIppt = HBufC8::NewL( entries );
-    CleanupStack::PushL( pptMarker->iIppt );
     pptMarker->iIppt->Des(  ).Append( iReader.iPtr, entries );
     iReader.iPtr += entries;
 
@@ -2372,8 +2321,7 @@
     
     // Append PPT to the current tile and decrement the tile length
     tile.AppendPPTL( pptMarker, markerLength + KMarkerSize );
-    CleanupStack::Pop(pptMarker->iIppt);
-    CleanupStack::PopAndDestroy(pptMarker);
+    CleanupStack::Pop(pptMarker);
 
     // Any valid marker may come after PPT marker
     iFHState = EStateInUnknown;
@@ -2411,8 +2359,7 @@
         }
 
     TPLTMarker *pltMarker = new ( ELeave ) TPLTMarker;
-    CleanupStack::PushL( pltMarker );
-    //CleanupDeletePushL( pltMarker );
+    CleanupDeletePushL( pltMarker );
 
     pltMarker->iZplt = *iReader.iPtr++;
 
@@ -2434,8 +2381,7 @@
 
     // Append PLT to the current tile and decrement the tile length
     tile.AppendPLTL( pltMarker, markerLength + KMarkerSize );
-    //CleanupStack::Pop();
-    CleanupStack::PopAndDestroy(pltMarker);
+    CleanupStack::Pop(pltMarker);
 
     // Any valid marker may come after PLT marker
     iFHState = EStateInUnknown;
--- a/imagingmodules/jp2kcodec/Src/JP2KImageData.cpp	Sat Feb 20 00:07:53 2010 +0200
+++ b/imagingmodules/jp2kcodec/Src/JP2KImageData.cpp	Wed Mar 31 23:34:12 2010 +0300
@@ -63,11 +63,9 @@
 TImageDataBlock* TJp2kComment::DuplicateL( CFrameImageData& aFrameImageData ) const
     {
     TJp2kComment *jp2kComment = new ( ELeave ) TJp2kComment( *this );
-    //CleanupDeletePushL( jp2kComment );
-    CleanupStack::PushL( jp2kComment );
+    CleanupDeletePushL( jp2kComment );
 
     jp2kComment->iComment = jp2kComment->iComment->AllocLC();
-    CleanupStack::PushL( jp2kComment->iComment );
 
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kComment->iComment ) );
     CleanupStack::Pop( 2 ); // jp2kComment and jp2kComment->iComment
@@ -95,11 +93,9 @@
 TImageDataBlock* TJp2kIprBox::DuplicateL( CFrameImageData& aFrameImageData ) const
     {
     TJp2kIprBox *jp2kIprBox = new ( ELeave ) TJp2kIprBox( *this );
-    //CleanupDeletePushL( jp2kIprBox );
-    CleanupStack::PushL( jp2kIprBox );
+    CleanupDeletePushL( jp2kIprBox );
 
     jp2kIprBox->iIprData = jp2kIprBox->iIprData->AllocLC();
-    CleanupStack::PushL( jp2kIprBox->iIprData );
 
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kIprBox->iIprData ) );
     CleanupStack::Pop( 2 ); // jp2kIprBox and jp2kIprBox->iIprData
@@ -127,11 +123,9 @@
 TImageDataBlock* TJp2kXmlBox::DuplicateL( CFrameImageData& aFrameImageData ) const
     {
     TJp2kXmlBox *jp2kXmlBox = new ( ELeave ) TJp2kXmlBox( *this );
-    //CleanupDeletePushL( jp2kXmlBox );
-    CleanupStack::PushL(jp2kXmlBox);
+    CleanupDeletePushL( jp2kXmlBox );
 
     jp2kXmlBox->iXmlData = jp2kXmlBox->iXmlData->AllocLC();
-    CleanupStack::PushL(jp2kXmlBox->iXmlData);
 
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kXmlBox->iXmlData ) );
     CleanupStack::Pop( 2 ); // jp2kXmlBox and jp2kXmlBox->iXmlData
@@ -160,11 +154,9 @@
 TImageDataBlock* TJp2kUuidBox::DuplicateL( CFrameImageData& aFrameImageData ) const
     {
     TJp2kUuidBox *jp2kUuidBox = new ( ELeave ) TJp2kUuidBox( *this );
-    //CleanupDeletePushL( jp2kUuidBox );
-    CleanupStack::PushL( jp2kUuidBox );
+    CleanupDeletePushL( jp2kUuidBox );
 
     jp2kUuidBox->iUuidData = jp2kUuidBox->iUuidData->AllocLC();
-    CleanupStack::PushL( jp2kUuidBox->iUuidData );
 
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kUuidBox->iUuidData ) );
     CleanupStack::Pop( 2 ); // jp2kUuidBox and jp2kUuidBox->iUuidData
@@ -196,16 +188,13 @@
 TImageDataBlock* TJp2kUuidInfoBox::DuplicateL( CFrameImageData& aFrameImageData ) const
     {
     TJp2kUuidInfoBox *jp2kUuidInfoBox = new ( ELeave ) TJp2kUuidInfoBox( *this );
-    //CleanupDeletePushL( jp2kUuidInfoBox );
-    CleanupStack::PushL( jp2kUuidInfoBox );
+    CleanupDeletePushL( jp2kUuidInfoBox );
 
     jp2kUuidInfoBox->iUuidInfoId = jp2kUuidInfoBox->iUuidInfoId->AllocLC();
-    CleanupStack::PushL( jp2kUuidInfoBox->iUuidInfoId );
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kUuidInfoBox->iUuidInfoId ) );
     CleanupStack::Pop( 1 ); // jp2kUuidInfoBox->iUuidInfoId
 
     jp2kUuidInfoBox->iUuidInfoData = jp2kUuidInfoBox->iUuidInfoData->AllocLC();
-    CleanupStack::PushL( jp2kUuidInfoBox->iUuidInfoData );
     User::LeaveIfError( aFrameImageData.AppendImageBuffer( jp2kUuidInfoBox->iUuidInfoData ) );
     CleanupStack::Pop( 2 ); // jp2kUuidInfoBox and jp2kUuidInfoBox->iUuidInfoData
 
--- a/package_definition.xml	Sat Feb 20 00:07:53 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
-  <package id="imagingext" name="Imaging Extensions" levels="adaptation hw-if plugin framework server app-if">
-    <collection id="imageadaptationextensions" name="Image Adaptation Extensions" level="app-if">
-      <component id="iclextjpegapi" filter="s60" name="ICL Extension JPEG API">
-        <unit bldFile="imageadaptationextensions/iclextjpegapi/group"/>
-      </component>
-      <component id="imageadaptationextensions_build" filter="s60" name="Image Adaptation Extensions Build">
-      	<!--  consider moving the export from this bld.inf into the above one and remove this component -->
-        <unit bldFile="imageadaptationextensions/group"/>
-      </component>
-    </collection>
-    <collection id="imagingmodules" name="Imaging Modules" level="hw-if">
-      <component id="exiflib" filter="s60" name="Exif Library">
-        <unit bldFile="imagingmodules/exiflib/group"/>
-      </component>
-      <component id="jp2kcodec" filter="s60" name="JPEG2000 Decoder Plugin" class="plugin">
-        <unit bldFile="imagingmodules/jp2kcodec/group"/>
-      </component>
-    </collection>
-    <collection id="imagingext_info" name="Imaging Extensions Info" level="app-if">
-      <component id="imagingext_plat" filter="s60" name="Imaging Extensions Platform Interfaces" class="api">
-        <unit bldFile="imagingext_plat/group"/>
-      </component>
-      <component id="imagingext_build" filter="s60" name="Imaging Extensions Build">
-        <unit bldFile="group"/>
-      </component>
-      <component id="imagingext_pub" filter="s60" name="Imaging Extensions Public Interfaces" class="api">
-        <unit bldFile="imagingext_pub/group"/>
-        <!-- does this tes unit need to be #included in the above one? -->
-        <!-- <unit bldFile="imagingext_pub/exif_api/tsrc/group"/> -->
-      </component>
-    </collection>
-  </package>
-</SystemDefinition>