codec_api.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /*!
  2. *@page License
  3. *
  4. * \copy
  5. * Copyright (c) 2013, Cisco Systems
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * * Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. *
  15. * * Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in
  17. * the documentation and/or other materials provided with the
  18. * distribution.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  23. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  24. * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  25. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  26. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  27. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  28. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  30. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  31. * POSSIBILITY OF SUCH DAMAGE.
  32. *
  33. */
  34. #ifndef WELS_VIDEO_CODEC_SVC_API_H__
  35. #define WELS_VIDEO_CODEC_SVC_API_H__
  36. #ifndef __cplusplus
  37. #if defined(_MSC_VER) && (_MSC_VER < 1800)
  38. typedef unsigned char bool;
  39. #else
  40. #include <stdbool.h>
  41. #endif
  42. #endif
  43. #include "codec_app_def.h"
  44. #include "codec_def.h"
  45. #if defined(_WIN32) || defined(__cdecl)
  46. #define EXTAPI __cdecl
  47. #else
  48. #define EXTAPI
  49. #endif
  50. /**
  51. * @file codec_api.h
  52. */
  53. /**
  54. * @page Overview
  55. * * This page is for openh264 codec API usage.
  56. * * For how to use the encoder,please refer to page UsageExampleForEncoder
  57. * * For how to use the decoder,please refer to page UsageExampleForDecoder
  58. * * For more detail about ISVEncoder,please refer to page ISVCEnoder
  59. * * For more detail about ISVDecoder,please refer to page ISVCDecoder
  60. */
  61. /**
  62. * @page DecoderUsageExample
  63. *
  64. * @brief
  65. * * An example for using the decoder for Decoding only or Parsing only
  66. *
  67. * Step 1:decoder declaration
  68. * @code
  69. *
  70. * //decoder declaration
  71. * ISVCDecoder *pSvcDecoder;
  72. * //input: encoded bitstream start position; should include start code prefix
  73. * unsigned char *pBuf =...;
  74. * //input: encoded bit stream length; should include the size of start code prefix
  75. * int iSize =...;
  76. * //output: [0~2] for Y,U,V buffer for Decoding only
  77. * unsigned char *pData[3] =...;
  78. * //in-out: for Decoding only: declare and initialize the output buffer info, this should never co-exist with Parsing only
  79. * SBufferInfo sDstBufInfo;
  80. * memset(&sDstBufInfo, 0, sizeof(SBufferInfo));
  81. * //in-out: for Parsing only: declare and initialize the output bitstream buffer info for parse only, this should never co-exist with Decoding only
  82. * SParserBsInfo sDstParseInfo;
  83. * memset(&sDstParseInfo, 0, sizeof(SParserBsInfo));
  84. * sDstParseInfo.pDstBuff = new unsigned char[PARSE_SIZE]; //In Parsing only, allocate enough buffer to save transcoded bitstream for a frame
  85. *
  86. * @endcode
  87. *
  88. * Step 2:decoder creation
  89. * @code
  90. * CreateDecoder(pSvcDecoder);
  91. * @endcode
  92. *
  93. * Step 3:declare required parameter, used to differentiate Decoding only and Parsing only
  94. * @code
  95. * SDecodingParam sDecParam = {0};
  96. * sDecParam.sVideoProperty.eVideoBsType = VIDEO_BITSTREAM_AVC;
  97. * //for Parsing only, the assignment is mandatory
  98. * sDecParam.bParseOnly = true;
  99. * @endcode
  100. *
  101. * Step 4:initialize the parameter and decoder context, allocate memory
  102. * @code
  103. * Initialize(&sDecParam);
  104. * @endcode
  105. *
  106. * Step 5:do actual decoding process in slice level;
  107. * this can be done in a loop until data ends
  108. * @code
  109. * //for Decoding only
  110. * iRet = DecodeFrameNoDelay(pBuf, iSize, pData, &sDstBufInfo);
  111. * //or
  112. * iRet = DecodeFrame2(pBuf, iSize, pData, &sDstBufInfo);
  113. * //for Parsing only
  114. * iRet = DecodeParser(pBuf, iSize, &sDstParseInfo);
  115. * //decode failed
  116. * If (iRet != 0){
  117. * RequestIDR or something like that.
  118. * }
  119. * //for Decoding only, pData can be used for render.
  120. * if (sDstBufInfo.iBufferStatus==1){
  121. * output pData[0], pData[1], pData[2];
  122. * }
  123. * //for Parsing only, sDstParseInfo can be used for, e.g., HW decoding
  124. * if (sDstBufInfo.iNalNum > 0){
  125. * Hardware decoding sDstParseInfo;
  126. * }
  127. * //no-delay decoding can be realized by directly calling DecodeFrameNoDelay(), which is the recommended usage.
  128. * //no-delay decoding can also be realized by directly calling DecodeFrame2() again with NULL input, as in the following. In this case, decoder would immediately reconstruct the input data. This can also be used similarly for Parsing only. Consequent decoding error and output indication should also be considered as above.
  129. * iRet = DecodeFrame2(NULL, 0, pData, &sDstBufInfo);
  130. * judge iRet, sDstBufInfo.iBufferStatus ...
  131. * @endcode
  132. *
  133. * Step 6:uninitialize the decoder and memory free
  134. * @code
  135. * Uninitialize();
  136. * @endcode
  137. *
  138. * Step 7:destroy the decoder
  139. * @code
  140. * DestroyDecoder();
  141. * @endcode
  142. *
  143. */
  144. /**
  145. * @page EncoderUsageExample1
  146. *
  147. * @brief
  148. * * An example for using encoder with basic parameter
  149. *
  150. * Step1:setup encoder
  151. * @code
  152. * int rv = WelsCreateSVCEncoder (&encoder_);
  153. * ASSERT_EQ (0, rv);
  154. * ASSERT_TRUE (encoder_ != NULL);
  155. * @endcode
  156. *
  157. * Step2:initilize with basic parameter
  158. * @code
  159. * SEncParamBase param;
  160. * memset (&param, 0, sizeof (SEncParamBase));
  161. * param.iUsageType = usageType;
  162. * param.fMaxFrameRate = frameRate;
  163. * param.iPicWidth = width;
  164. * param.iPicHeight = height;
  165. * param.iTargetBitrate = 5000000;
  166. * encoder_->Initialize (&param);
  167. * @endcode
  168. *
  169. * Step3:set option, set option during encoding process
  170. * @code
  171. * encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &g_LevelSetting);
  172. * int videoFormat = videoFormatI420;
  173. * encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
  174. * @endcode
  175. *
  176. * Step4: encode and store ouput bistream
  177. * @code
  178. * int frameSize = width * height * 3 / 2;
  179. * BufferedData buf;
  180. * buf.SetLength (frameSize);
  181. * ASSERT_TRUE (buf.Length() == (size_t)frameSize);
  182. * SFrameBSInfo info;
  183. * memset (&info, 0, sizeof (SFrameBSInfo));
  184. * SSourcePicture pic;
  185. * memset (&pic, 0, sizeof (SsourcePicture));
  186. * pic.iPicWidth = width;
  187. * pic.iPicHeight = height;
  188. * pic.iColorFormat = videoFormatI420;
  189. * pic.iStride[0] = pic.iPicWidth;
  190. * pic.iStride[1] = pic.iStride[2] = pic.iPicWidth >> 1;
  191. * pic.pData[0] = buf.data();
  192. * pic.pData[1] = pic.pData[0] + width * height;
  193. * pic.pData[2] = pic.pData[1] + (width * height >> 2);
  194. * for(int num = 0;num<total_num;num++) {
  195. * //prepare input data
  196. * rv = encoder_->EncodeFrame (&pic, &info);
  197. * ASSERT_TRUE (rv == cmResultSuccess);
  198. * if (info.eFrameType != videoFrameTypeSkip && cbk != NULL) {
  199. * //output bitstream
  200. * }
  201. * }
  202. * @endcode
  203. *
  204. * Step5:teardown encoder
  205. * @code
  206. * if (encoder_) {
  207. * encoder_->Uninitialize();
  208. * WelsDestroySVCEncoder (encoder_);
  209. * }
  210. * @endcode
  211. *
  212. */
  213. /**
  214. * @page EncoderUsageExample2
  215. *
  216. * @brief
  217. * * An example for using the encoder with extension parameter.
  218. * * The same operation on Step 1,3,4,5 with Example-1
  219. *
  220. * Step 2:initialize with extension parameter
  221. * @code
  222. * SEncParamExt param;
  223. * encoder->GetDefaultParams (&param);
  224. * param.iUsageType = usageType;
  225. * param.fMaxFrameRate = frameRate;
  226. * param.iPicWidth = width;
  227. * param.iPicHeight = height;
  228. * param.iTargetBitrate = 5000000;
  229. * param.bEnableDenoise = denoise;
  230. * param.iSpatialLayerNum = layers;
  231. * //SM_DYN_SLICE don't support multi-thread now
  232. * if (sliceMode != SM_SINGLE_SLICE && sliceMode != SM_DYN_SLICE)
  233. * param.iMultipleThreadIdc = 2;
  234. *
  235. * for (int i = 0; i < param.iSpatialLayerNum; i++) {
  236. * param.sSpatialLayers[i].iVideoWidth = width >> (param.iSpatialLayerNum - 1 - i);
  237. * param.sSpatialLayers[i].iVideoHeight = height >> (param.iSpatialLayerNum - 1 - i);
  238. * param.sSpatialLayers[i].fFrameRate = frameRate;
  239. * param.sSpatialLayers[i].iSpatialBitrate = param.iTargetBitrate;
  240. *
  241. * param.sSpatialLayers[i].sSliceCfg.uiSliceMode = sliceMode;
  242. * if (sliceMode == SM_DYN_SLICE) {
  243. * param.sSpatialLayers[i].sSliceCfg.sSliceArgument.uiSliceSizeConstraint = 600;
  244. * param.uiMaxNalSize = 1500;
  245. * }
  246. * }
  247. * param.iTargetBitrate *= param.iSpatialLayerNum;
  248. * encoder_->InitializeExt (&param);
  249. * int videoFormat = videoFormatI420;
  250. * encoder_->SetOption (ENCODER_OPTION_DATAFORMAT, &videoFormat);
  251. *
  252. * @endcode
  253. */
  254. #ifdef __cplusplus
  255. /**
  256. * @brief Endocder definition
  257. */
  258. class ISVCEncoder {
  259. public:
  260. /**
  261. * @brief Initialize the encoder
  262. * @param pParam basic encoder parameter
  263. * @return CM_RETURN: 0 - success; otherwise - failed;
  264. */
  265. virtual int EXTAPI Initialize (const SEncParamBase* pParam) = 0;
  266. /**
  267. * @brief Initilaize encoder by using extension parameters.
  268. * @param pParam extension parameter for encoder
  269. * @return CM_RETURN: 0 - success; otherwise - failed;
  270. */
  271. virtual int EXTAPI InitializeExt (const SEncParamExt* pParam) = 0;
  272. /**
  273. * @brief Get the default extension parameters.
  274. * If you want to change some parameters of encoder, firstly you need to get the default encoding parameters,
  275. * after that you can change part of parameters you want to.
  276. * @param pParam extension parameter for encoder
  277. * @return CM_RETURN: 0 - success; otherwise - failed;
  278. * */
  279. virtual int EXTAPI GetDefaultParams (SEncParamExt* pParam) = 0;
  280. /// uninitialize the encoder
  281. virtual int EXTAPI Uninitialize() = 0;
  282. /**
  283. * @brief Encode one frame
  284. * @param kpSrcPic the pointer to the source luminance plane
  285. * chrominance data:
  286. * CbData = kpSrc + m_iMaxPicWidth * m_iMaxPicHeight;
  287. * CrData = CbData + (m_iMaxPicWidth * m_iMaxPicHeight)/4;
  288. * the application calling this interface needs to ensure the data validation between the location
  289. * @param pBsInfo output bit stream
  290. * @return 0 - success; otherwise -failed;
  291. */
  292. virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
  293. /**
  294. * @brief Encode the parameters from output bit stream
  295. * @param pBsInfo output bit stream
  296. * @return 0 - success; otherwise - failed;
  297. */
  298. virtual int EXTAPI EncodeParameterSets (SFrameBSInfo* pBsInfo) = 0;
  299. /**
  300. * @brief Force encoder to encoder frame as IDR if bIDR set as true
  301. * @param bIDR true: force encoder to encode frame as IDR frame;false, return 1 and nothing to do
  302. * @return 0 - success; otherwise - failed;
  303. */
  304. virtual int EXTAPI ForceIntraFrame (bool bIDR) = 0;
  305. /**
  306. * @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
  307. * @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
  308. * @return CM_RETURN: 0 - success; otherwise - failed;
  309. */
  310. virtual int EXTAPI SetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
  311. /**
  312. * @brief Set option for encoder, detail option type, please refer to enumurate ENCODER_OPTION.
  313. * @param pOption option for encoder such as InDataFormat, IDRInterval, SVC Encode Param, Frame Rate, Bitrate,...
  314. * @return CM_RETURN: 0 - success; otherwise - failed;
  315. */
  316. virtual int EXTAPI GetOption (ENCODER_OPTION eOptionId, void* pOption) = 0;
  317. virtual ~ISVCEncoder() {}
  318. };
  319. /**
  320. * @brief Decoder definition
  321. */
  322. class ISVCDecoder {
  323. public:
  324. /**
  325. * @brief Initilaize decoder
  326. * @param pParam parameter for decoder
  327. * @return 0 - success; otherwise - failed;
  328. */
  329. virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
  330. /// Uninitialize the decoder
  331. virtual long EXTAPI Uninitialize() = 0;
  332. /**
  333. * @brief Decode one frame
  334. * @param pSrc the h264 stream to be decoded
  335. * @param iSrcLen the length of h264 stream
  336. * @param ppDst buffer pointer of decoded data (YUV)
  337. * @param pStride output stride
  338. * @param iWidth output width
  339. * @param iHeight output height
  340. * @return 0 - success; otherwise -failed;
  341. */
  342. virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
  343. const int iSrcLen,
  344. unsigned char** ppDst,
  345. int* pStride,
  346. int& iWidth,
  347. int& iHeight) = 0;
  348. /**
  349. * @brief For slice level DecodeFrameNoDelay() (4 parameters input),
  350. * whatever the function return value is, the output data
  351. * of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
  352. * This function will parse and reconstruct the input frame immediately if it is complete
  353. * It is recommended as the main decoding function for H.264/AVC format input
  354. * @param pSrc the h264 stream to be decoded
  355. * @param iSrcLen the length of h264 stream
  356. * @param ppDst buffer pointer of decoded data (YUV)
  357. * @param pDstInfo information provided to API(width, height, etc.)
  358. * @return 0 - success; otherwise -failed;
  359. */
  360. virtual DECODING_STATE EXTAPI DecodeFrameNoDelay (const unsigned char* pSrc,
  361. const int iSrcLen,
  362. unsigned char** ppDst,
  363. SBufferInfo* pDstInfo) = 0;
  364. /**
  365. * @brief For slice level DecodeFrame2() (4 parameters input),
  366. * whatever the function return value is, the output data
  367. * of I420 format will only be available when pDstInfo->iBufferStatus == 1,.
  368. * (e.g., in multi-slice cases, only when the whole picture
  369. * is completely reconstructed, this variable would be set equal to 1.)
  370. * @param pSrc the h264 stream to be decoded
  371. * @param iSrcLen the length of h264 stream
  372. * @param ppDst buffer pointer of decoded data (YUV)
  373. * @param pDstInfo information provided to API(width, height, etc.)
  374. * @return 0 - success; otherwise -failed;
  375. */
  376. virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
  377. const int iSrcLen,
  378. unsigned char** ppDst,
  379. SBufferInfo* pDstInfo) = 0;
  380. /**
  381. * @brief This function parse input bitstream only, and rewrite possible SVC syntax to AVC syntax
  382. * @param pSrc the h264 stream to be decoded
  383. * @param iSrcLen the length of h264 stream
  384. * @param pDstInfo bit stream info
  385. * @return 0 - success; otherwise -failed;
  386. */
  387. virtual DECODING_STATE EXTAPI DecodeParser (const unsigned char* pSrc,
  388. const int iSrcLen,
  389. SParserBsInfo* pDstInfo) = 0;
  390. /**
  391. * @brief This API does not work for now!! This is for future use to support non-I420 color format output.
  392. * @param pSrc the h264 stream to be decoded
  393. * @param iSrcLen the length of h264 stream
  394. * @param pDst buffer pointer of decoded data (YUV)
  395. * @param iDstStride output stride
  396. * @param iDstLen bit stream info
  397. * @param iWidth output width
  398. * @param iHeight output height
  399. * @param iColorFormat output color format
  400. * @return to do ...
  401. */
  402. virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* pSrc,
  403. const int iSrcLen,
  404. unsigned char* pDst,
  405. int iDstStride,
  406. int& iDstLen,
  407. int& iWidth,
  408. int& iHeight,
  409. int& iColorFormat) = 0;
  410. /**
  411. * @brief Set option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
  412. * @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
  413. * @return CM_RETURN: 0 - success; otherwise - failed;
  414. */
  415. virtual long EXTAPI SetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
  416. /**
  417. * @brief Get option for decoder, detail option type, please refer to enumurate DECODER_OPTION.
  418. * @param pOption option for decoder such as OutDataFormat, Eos Flag, EC method, ...
  419. * @return CM_RETURN: 0 - success; otherwise - failed;
  420. */
  421. virtual long EXTAPI GetOption (DECODER_OPTION eOptionId, void* pOption) = 0;
  422. virtual ~ISVCDecoder() {}
  423. };
  424. extern "C"
  425. {
  426. #else
  427. typedef struct ISVCEncoderVtbl ISVCEncoderVtbl;
  428. typedef const ISVCEncoderVtbl* ISVCEncoder;
  429. struct ISVCEncoderVtbl {
  430. int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam);
  431. int (*InitializeExt) (ISVCEncoder*, const SEncParamExt* pParam);
  432. int (*GetDefaultParams) (ISVCEncoder*, SEncParamExt* pParam);
  433. int (*Uninitialize) (ISVCEncoder*);
  434. int (*EncodeFrame) (ISVCEncoder*, const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo);
  435. int (*EncodeParameterSets) (ISVCEncoder*, SFrameBSInfo* pBsInfo);
  436. int (*ForceIntraFrame) (ISVCEncoder*, bool bIDR);
  437. int (*SetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
  438. int (*GetOption) (ISVCEncoder*, ENCODER_OPTION eOptionId, void* pOption);
  439. };
  440. typedef struct ISVCDecoderVtbl ISVCDecoderVtbl;
  441. typedef const ISVCDecoderVtbl* ISVCDecoder;
  442. struct ISVCDecoderVtbl {
  443. long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
  444. long (*Uninitialize) (ISVCDecoder*);
  445. DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
  446. const int iSrcLen,
  447. unsigned char** ppDst,
  448. int* pStride,
  449. int* iWidth,
  450. int* iHeight);
  451. DECODING_STATE (*DecodeFrameNoDelay) (ISVCDecoder*, const unsigned char* pSrc,
  452. const int iSrcLen,
  453. unsigned char** ppDst,
  454. SBufferInfo* pDstInfo);
  455. DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
  456. const int iSrcLen,
  457. unsigned char** ppDst,
  458. SBufferInfo* pDstInfo);
  459. DECODING_STATE (*DecodeParser) (ISVCDecoder*, const unsigned char* pSrc,
  460. const int iSrcLen,
  461. SParserBsInfo* pDstInfo);
  462. DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,
  463. const int iSrcLen,
  464. unsigned char* pDst,
  465. int iDstStride,
  466. int* iDstLen,
  467. int* iWidth,
  468. int* iHeight,
  469. int* iColorFormat);
  470. long (*SetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
  471. long (*GetOption) (ISVCDecoder*, DECODER_OPTION eOptionId, void* pOption);
  472. };
  473. #endif
  474. typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string);
  475. /** @brief Create encoder
  476. * @param ppEncoder encoder
  477. * @return 0 - success; otherwise - failed;
  478. */
  479. int WelsCreateSVCEncoder (ISVCEncoder** ppEncoder);
  480. /** @brief Destroy encoder
  481. * @param pEncoder encoder
  482. * @return void
  483. */
  484. void WelsDestroySVCEncoder (ISVCEncoder* pEncoder);
  485. /** @brief Get the capability of decoder
  486. * @param pDecCapability decoder capability
  487. * @return 0 - success; otherwise - failed;
  488. */
  489. int WelsGetDecoderCapability (SDecoderCapability* pDecCapability);
  490. /** @brief Create decoder
  491. * @param ppDecoder decoder
  492. * @return 0 - success; otherwise - failed;
  493. */
  494. long WelsCreateDecoder (ISVCDecoder** ppDecoder);
  495. /** @brief Destroy decoder
  496. * @param pDecoder decoder
  497. * @return void
  498. */
  499. void WelsDestroyDecoder (ISVCDecoder* pDecoder);
  500. /** @brief Get codec version
  501. * Note, old versions of Mingw (GCC < 4.7) are buggy and use an
  502. * incorrect/different ABI for calling this function, making it
  503. * incompatible with MSVC builds.
  504. * @return The linked codec version
  505. */
  506. OpenH264Version WelsGetCodecVersion (void);
  507. /** @brief Get codec version
  508. * @param pVersion struct to fill in with the version
  509. */
  510. void WelsGetCodecVersionEx (OpenH264Version *pVersion);
  511. #ifdef __cplusplus
  512. }
  513. #endif
  514. #endif//WELS_VIDEO_CODEC_SVC_API_H__