applications/Symbian_MiniGUI_TestApp/yuv.cpp
changeset 69 c9d64fb26f98
parent 68 535d0a02b797
equal deleted inserted replaced
68:535d0a02b797 69:c9d64fb26f98
    61 	User::LeaveIfError(surfaceManager.Open());
    61 	User::LeaveIfError(surfaceManager.Open());
    62 	// Store the attributes used to create the Surface
    62 	// Store the attributes used to create the Surface
    63 	RSurfaceManager::TSurfaceCreationAttributesBuf buf;
    63 	RSurfaceManager::TSurfaceCreationAttributesBuf buf;
    64 	RSurfaceManager::TSurfaceCreationAttributes& attributes = buf();
    64 	RSurfaceManager::TSurfaceCreationAttributes& attributes = buf();
    65 
    65 
    66 	attributes.iSize = TSize(361,341);      // w > 0, h > 0
    66 	attributes.iSize = TSize(320, 240);      // w > 0, h > 0
    67 	attributes.iBuffers = 4;                // > 0, <= 4
    67 	attributes.iBuffers = 4;                // > 0, <= 4
    68 	attributes.iPixelFormat = EUidPixelFormatYUV_422Planar; // 2bpp
    68 	attributes.iPixelFormat = EUidPixelFormatYUV_422Interleaved; // 1bpp
    69 	attributes.iStride = 1400;              // > 0,  width * bpp
    69 	attributes.iStride = 320;              // > 0,  width * bpp
    70 	attributes.iOffsetToFirstBuffer = 184;  // > 0, divisible by alignment
    70 	attributes.iOffsetToFirstBuffer = 184;  // > 0, divisible by alignment
    71 	attributes.iAlignment = 4;              // 1 || 2 || 4 || 8
    71 	attributes.iAlignment = 4;              // 1 || 2 || 4 || 8
    72 	attributes.iContiguous = EFalse;
    72 	attributes.iContiguous = EFalse;
    73 	attributes.iMappable = ETrue;
    73 	attributes.iMappable = ETrue;
    74 
    74 
   100 	win.SetBackgroundSurface(surfaceId);
   100 	win.SetBackgroundSurface(surfaceId);
   101 	gc->Deactivate();
   101 	gc->Deactivate();
   102 	win.EndRedraw();
   102 	win.EndRedraw();
   103 	ws.Flush();
   103 	ws.Flush();
   104  	User::After(3000000);
   104  	User::After(3000000);
       
   105  	
       
   106  	win.RemoveBackgroundSurface(ETrue);
   105  	win.Close();
   107  	win.Close();
   106 	grp.Close();
   108 	grp.Close();
   107 	delete gc;
   109 	delete gc;
   108 	delete scr;
   110 	delete scr;
   109 	ws.Close();
   111 	ws.Close();