graphicscomposition/openwfcompositionengine/composition/src/wfcapi.c
branchRCL_3
changeset 20 25ffed67c7ef
parent 19 bbf46f59e123
equal deleted inserted replaced
19:bbf46f59e123 20:25ffed67c7ef
     1 /* Copyright (c) 2009-2010 The Khronos Group Inc.
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     2  * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
       
     3  *
     2  *
     4  * Permission is hereby granted, free of charge, to any person obtaining a
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     5  * copy of this software and/or associated documentation files (the
     4  * copy of this software and/or associated documentation files (the
     6  * "Materials"), to deal in the Materials without restriction, including
     5  * "Materials"), to deal in the Materials without restriction, including
     7  * without limitation the rights to use, copy, modify, merge, publish,
     6  * without limitation the rights to use, copy, modify, merge, publish,
   257 
   256 
   258     if (screenNumber == WFC_DEFAULT_SCREEN_NUMBER)
   257     if (screenNumber == WFC_DEFAULT_SCREEN_NUMBER)
   259     {
   258     {
   260         screenNumber = OWF_Screen_GetDefaultNumber();
   259         screenNumber = OWF_Screen_GetDefaultNumber();
   261     }
   260     }
   262     
   261     else
   263     /* check screen number validity */
   262     {
   264     if (!OWF_Screen_Valid(screenNumber))
   263         /* check screen number validity */
   265     {
   264         if (!OWF_Screen_Valid(screenNumber))
   266         FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE);
   265         {
       
   266             FAIL(WFC_ERROR_UNSUPPORTED, WFC_INVALID_HANDLE);
       
   267         }
   267     }
   268     }
   268 
   269 
   269     /* check that no other context currently uses this screen */
   270     /* check that no other context currently uses this screen */
   270     if (WFC_Device_FindScreenNumber(screenNumber))
   271     if (!OWF_Screen_Valid_And_Available(screenNumber))
   271     {
   272     {
   272         FAIL(WFC_ERROR_IN_USE, WFC_INVALID_HANDLE);
   273         FAIL(WFC_ERROR_IN_USE, WFC_INVALID_HANDLE);
   273     }
   274     }
   274 
   275 
   275 
   276 
   942         tmp = &wfc_strings[WFC_VERSION_INDEX];
   943         tmp = &wfc_strings[WFC_VERSION_INDEX];
   943         break;
   944         break;
   944 
   945 
   945     case WFC_EXTENSIONS:
   946     case WFC_EXTENSIONS:
   946         tmp = &wfc_extensions[0];
   947         tmp = &wfc_extensions[0];
   947 		/* we know that wfc_extensions always has NULL as the last member 
       
   948 		   so this loop will never exceed the size of tmp */
       
   949 		/* coverity[overrun-local] */
       
   950         for (retVal=0; tmp[retVal] != NULL; retVal++)
   948         for (retVal=0; tmp[retVal] != NULL; retVal++)
   951         {
   949         {
   952             /* get extensions array size */
   950             /* get extensions array size */
   953         }
   951         }
   954         break;
   952         break;
  1001 /*=========================================================================*/
   999 /*=========================================================================*/
  1002 /* 11. TEST ONLY API FOR ON SCREEN IMAGE EXPORTING                         */
  1000 /* 11. TEST ONLY API FOR ON SCREEN IMAGE EXPORTING                         */
  1003 /*=========================================================================*/
  1001 /*=========================================================================*/
  1004 
  1002 
  1005 WFC_API_CALL WFCNativeStreamType WFC_APIENTRY
  1003 WFC_API_CALL WFCNativeStreamType WFC_APIENTRY
  1006 extwfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT
  1004 wfcGetOnScreenStream(WFCDevice dev, WFCContext ctx) WFC_APIEXIT
  1007 {
  1005 {
  1008 	WFC_DEVICE*             device;
  1006 	WFC_DEVICE*             device;
  1009 	WFC_CONTEXT*            context;
  1007 	WFC_CONTEXT*            context;
  1010 
  1008 
  1011 	GET_DEVICE(device, dev, WFC_INVALID_HANDLE);
  1009 	GET_DEVICE(device, dev, WFC_INVALID_HANDLE);
  1015 	DPRINT(("  context = %p", context));
  1013 	DPRINT(("  context = %p", context));
  1016 
  1014 
  1017 	/* Protect context's target stream from being destroyed by the user
  1015 	/* Protect context's target stream from being destroyed by the user
  1018 	 * WFC_CONTEXT_Dtor will reset this flag. */
  1016 	 * WFC_CONTEXT_Dtor will reset this flag. */
  1019 	owfNativeStreamSetProtectionFlag(context->stream, OWF_TRUE);
  1017 	owfNativeStreamSetProtectionFlag(context->stream, OWF_TRUE);
  1020 	
       
  1021 	OWF_DisplayContext_FlagInternalStreamAccessed(context->displayContext);
       
  1022 
  1018 
  1023 	SUCCEED(context->stream);
  1019 	SUCCEED(context->stream);
  1024 }
  1020 }