MWCapture SDK Linux  3.3.1.LAST_SVN_COMMIT_NUM
mw_venc.h
1 #ifndef MW_VENC_H
2 #define MW_VENC_H
3 
5 // Copyright (c) 2011-2019 Magewell Electronics Co., Ltd. (Nanjing)
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a
8 // copy of this software and associated documentation files (the "Software"),
9 // to deal in the Software without restriction, including without limitation
10 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 // and/or sell copies of the Software, and to permit persons to whom the
12 // Software is furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included
15 // in all copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 // THE SOFTWARE.
25 
26 #ifdef _WIN32
27 #ifdef MWVENC_EXPORTS
28 #define MWVENC_API __declspec(dllexport)
29 #else
30 #define MWVENC_API __declspec(dllimport)
31 #endif
32 #endif
33 
34 #include "mw_venc_common.h"
35 
53 #ifdef _WIN32
54 MWVENC_API
55 #endif
57 
65 #ifdef _WIN32
66 MWVENC_API
67 #endif
69 
78 #ifdef _WIN32
79 MWVENC_API
80 #endif
81 int32_t mw_venc_get_gpu_num();
82 
119 #ifdef _WIN32
120 MWVENC_API
121 #endif
123 
124 typedef struct venc_handle *mw_venc_handle_t;
125 
163 #ifdef _WIN32
164 MWVENC_API
165 #endif
167 
193 #ifdef _WIN32
194 MWVENC_API
195 #endif
197 
273 #ifdef _WIN32
274 MWVENC_API
275 #endif
276 mw_venc_handle_t
278  mw_venc_platform_t platform,
279  mw_venc_param_t *p_param,
280  MW_ENCODER_CALLBACK frame_callback,
281  void *user_ptr);
282 
283 
350 #ifdef _WIN32
351 MWVENC_API
352 #endif
353 mw_venc_handle_t
355  int32_t index,
356  mw_venc_param_t *p_param,
357  MW_ENCODER_CALLBACK frame_callback,
358  void *user_ptr);
359 
388 #ifdef _WIN32
389 MWVENC_API
390 #endif
393  mw_venc_handle_t handle,
394  uint8_t *p_frame);
395 
424 #ifdef _WIN32
425 MWVENC_API
426 #endif
429  mw_venc_handle_t handle,
430  uint8_t *p_frame,
431  int64_t pts);
432 
452 #ifdef _WIN32
453 MWVENC_API
454 #endif
456 mw_venc_destory(mw_venc_handle_t handle);
457 
491 #ifdef _WIN32
492 MWVENC_API
493 #endif
496  mw_venc_handle_t handle,
497  mw_venc_property_t param,
498  void *args);
499 
529 #ifdef _WIN32
530 MWVENC_API
531 #endif
534  mw_venc_handle_t handle,
535  mw_venc_property_t param,
536  void *args);
537 
538 #endif
enum mw_venc_property mw_venc_property_t
mw_venc_property_t
mw_venc_status_t mw_venc_destory(mw_venc_handle_t handle)
Destroys encoders.
mw_venc_status_t mw_venc_get_default_param(mw_venc_param_t *p_param)
Gets the default value of encoding parameters.
mw_venc_status_t mw_venc_get_gpu_info_by_index(int32_t index, mw_venc_gpu_info_t *info)
Obtains hardware information of GPU by index.
mw_venc_handle_t mw_venc_create_by_index(int32_t index, mw_venc_param_t *p_param, MW_ENCODER_CALLBACK frame_callback, void *user_ptr)
Ctreats an encoder.
mw_venc_handle_t mw_venc_create(mw_venc_platform_t platform, mw_venc_param_t *p_param, MW_ENCODER_CALLBACK frame_callback, void *user_ptr)
Creates an encoder.
void(* MW_ENCODER_CALLBACK)(void *user_ptr, const uint8_t *p_frame, uint32_t frame_len, mw_venc_frame_info_t *p_frame_info)
Callback functions.
Definition: mw_venc_common.h:52
enum mw_venc_platform mw_venc_platform_t
mw_venc_platform_t
mw_venc_gpu_info_t
Definition: mw_venc_common.h:372
mw_venc_status_t mw_venc_init()
Initializes mw_venc.
mw_venc_status_t mw_venc_put_frame_ex(mw_venc_handle_t handle, uint8_t *p_frame, int64_t pts)
Imports data to encoders.
mw_venc_param_t
Definition: mw_venc_common.h:345
int32_t mw_venc_get_gpu_num()
Obtains the number of GPUs for hardware video encoding and decoding.
mw_venc_status_t mw_venc_put_frame(mw_venc_handle_t handle, uint8_t *p_frame)
Imports data to encoders.
mw_venc_status_t mw_venc_get_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Gets encoder parameters.
uint32_t mw_venc_get_support_platfrom()
Gets supported encoding hardware platform.
mw_venc_status_t mw_venc_set_property(mw_venc_handle_t handle, mw_venc_property_t param, void *args)
Sets encoder parameters.
enum mw_venc_status mw_venc_status_t
mw_venc_status_t
mw_venc_status_t mw_venc_deinit()
Destroys mw_venc.