ecamusecasehintcustomapi.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
  3. * All rights reserved.
  4. * This component and the accompanying materials are made available
  5. * under the terms of "Eclipse Public License v1.0"
  6. * which accompanies this distribution, and is available
  7. * at the URL "http://www.eclipse.org/legal/epl-v10.html".
  8. *
  9. * Initial Contributors:
  10. * Nokia Corporation - initial contribution.
  11. *
  12. * Contributors:
  13. *
  14. * Description: This Custom API provides use case hints to camera.
  15. * Application can use this custom interface to notify camera
  16. * which use case it's going to use before reserving camera.
  17. * Based on this information camera adaptation can optimize
  18. * resource allocation so that camera is able to start up faster
  19. * for the particular use case.
  20. *
  21. */
  22. #ifndef ECAMUSECASEHINTCUSTOMAPI_H
  23. #define ECAMUSECASEHINTCUSTOMAPI_H
  24. #include <e32base.h>
  25. #include <ecam.h>
  26. // CONSTANTS
  27. const TUid KCameraUseCaseHintUid = { 0x2002EA1A };
  28. // CLASS DECLARATION
  29. /**
  30. * Custom interface for providing use case hints to camera.
  31. */
  32. class MCameraUseCaseHint
  33. {
  34. public: // Enumerations
  35. /**
  36. * List of codecs for encoded video
  37. * @see HintDirectVideoCaptureL()
  38. */
  39. enum TVideoCodec
  40. {
  41. ECodecUnknown = 0,
  42. ECodecMpeg4,
  43. ECodecH263,
  44. ECodecH264,
  45. ECodecVC1,
  46. ECodecSorenson,
  47. ECodecOn2Vp6,
  48. ECodecOn2Vp7,
  49. };
  50. /**
  51. * List of profiles for encoded video
  52. * @see HintDirectVideoCaptureL()
  53. */
  54. enum TVideoProfile
  55. {
  56. EProfileUnknown = 0,
  57. EProfileMPEG4SpL0 = 0x1000,
  58. EProfileMPEG4SpL0b,
  59. EProfileMPEG4SpL1,
  60. EProfileMPEG4SpL2,
  61. EProfileMPEG4SpL3,
  62. EProfileMPEG4SpL4a,
  63. EProfileMPEG4SpL5,
  64. EProfileMPEG4SpL6,
  65. EProfileMPEG4AspL0,
  66. EProfileMPEG4AspL0b,
  67. EProfileMPEG4AspL1,
  68. EProfileMPEG4AspL2,
  69. EProfileMPEG4AspL3,
  70. EProfileMPEG4AspL3b,
  71. EProfileMPEG4AspL4,
  72. EProfileMPEG4AspL4a,
  73. EProfileMPEG4AspL5,
  74. EProfileMPEG4AspL6,
  75. EProfileH263P0L10 = 0x2000,
  76. EProfileH263P0L20,
  77. EProfileH263P0L30,
  78. EProfileH263P0L40,
  79. EProfileH263P0L45,
  80. EProfileH264BpL1 = 0x3000,
  81. EProfileH264BpL1b,
  82. EProfileH264BpL1_1,
  83. EProfileH264BpL1_2,
  84. EProfileH264BpL1_3,
  85. EProfileH264BpL2,
  86. EProfileH264BpL2_1,
  87. EProfileH264BpL2_2,
  88. EProfileH264BpL3,
  89. EProfileH264BpL3_1,
  90. EProfileH264BpL3_2,
  91. EProfileH264BpL4,
  92. EProfileH264MpL1,
  93. EProfileH264MpL1b,
  94. EProfileH264MpL1_1,
  95. EProfileH264MpL1_2,
  96. EProfileH264MpL1_3,
  97. EProfileH264MpL2,
  98. EProfileH264MpL2_1,
  99. EProfileH264MpL2_2,
  100. EProfileH264MpL3,
  101. EProfileH264MpL3_1,
  102. EProfileH264MpL3_2,
  103. EProfileH264MpL4,
  104. EProfileH264HpL1,
  105. EProfileH264HpL1b,
  106. EProfileH264HpL1_1,
  107. EProfileH264HpL1_2,
  108. EProfileH264HpL1_3,
  109. EProfileH264HpL2,
  110. EProfileH264HpL2_1,
  111. EProfileH264HpL2_2,
  112. EProfileH264HpL3,
  113. EProfileH264HpL3_1,
  114. EProfileH264HpL3_2,
  115. EProfileH264HpL4,
  116. EProfileVC1SpLL = 0x4000,
  117. EProfileVC1SpLM,
  118. EProfileVC1MpLL,
  119. EProfileVC1MpLM,
  120. EProfileVC1MpLH,
  121. EProfileVC1ApL0,
  122. EProfileVC1ApL1,
  123. EProfileVC1ApL2,
  124. EProfileSSGeneric = 0x5000,
  125. EProfileVP6Generic = 0x6000,
  126. };
  127. public: // Methods
  128. /**
  129. * Gives a hint to camera that client wants to capture encoded video.
  130. *
  131. * This method should be called after calling CCamera::New2L() and
  132. * before CCamera::Reserve().
  133. *
  134. * @param aCodec Codec of the encoded video.
  135. * @param aProfile Profile of the encoded video.
  136. * @param aResolution Resolution of the encoded video.
  137. * @leave KErrInUse if this method is not called at the right time.
  138. * @leave KErrNotSupported if given codec/profile/resolution is not
  139. * supported.
  140. */
  141. virtual void HintDirectVideoCaptureL(
  142. TVideoCodec aCodec,
  143. TVideoProfile aProfile,
  144. const TSize& aResolution ) = 0;
  145. /**
  146. * Gives a hint to camera that client wants to capture non-encoded video.
  147. *
  148. * This method should be called after calling CCamera::New2L() and
  149. * before CCamera::Reserve().
  150. *
  151. * @param aFormat Format. Must be one of the supported video frame formats
  152. (see TCameraInfo::iVideoFrameFormatsSupported).
  153. * @param aSizeIndex Size index. Must be in the range 0 to
  154. TCameraInfo::iNumVideoFrameSizesSupported-1 inclusive.
  155. * @param aRateIndex Rate index. Must be in the range 0 to
  156. TCameraInfo::iNumVideoFrameRatesSupported-1 inclusive.
  157. * @leave KErrInUse if this method is not called at the right time.
  158. * @leave KErrNotSupported if given format/size/rate is not supported.
  159. */
  160. virtual void HintVideoCaptureL(
  161. CCamera::TFormat aFormat,
  162. TInt aSizeIndex,
  163. TInt aRateIndex ) = 0;
  164. /**
  165. * Gives a hint to camera that client wants to capture still images.
  166. *
  167. * This method should be called after calling CCamera::New2L() and
  168. * before CCamera::Reserve().
  169. *
  170. * @param aFormat Format. Must be one of the supported still formats
  171. * (see TCameraInfo::iImageFormatsSupported).
  172. * @param aSizeIndex Size index. Must be in the range of 0 to
  173. * TCameraInfo::iNumImageSizesSupported-1 inclusive.
  174. * @leave KErrInUse if this method is not called at the right time.
  175. * @leave KErrNotSupported if given format/size/rate is not supported.
  176. */
  177. virtual void HintStillCaptureL(
  178. CCamera::TFormat aFormat,
  179. TInt aSizeIndex ) = 0;
  180. };
  181. #endif //ECAMUSECASEHINTCUSTOMAPI_H