|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef OPENCV_GAPI_STREAMING_ONEVPL_CFG_PARAMS_HPP |
|
|
#define OPENCV_GAPI_STREAMING_ONEVPL_CFG_PARAMS_HPP |
|
|
|
|
|
#include <map> |
|
|
#include <memory> |
|
|
#include <string> |
|
|
|
|
|
#include <opencv2/gapi/streaming/source.hpp> |
|
|
#include <opencv2/gapi/util/variant.hpp> |
|
|
|
|
|
namespace cv { |
|
|
namespace gapi { |
|
|
namespace wip { |
|
|
namespace onevpl { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct GAPI_EXPORTS CfgParam { |
|
|
using name_t = std::string; |
|
|
using value_t = cv::util::variant<uint8_t, int8_t, |
|
|
uint16_t, int16_t, |
|
|
uint32_t, int32_t, |
|
|
uint64_t, int64_t, |
|
|
float_t, |
|
|
double_t, |
|
|
void*, |
|
|
std::string>; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static constexpr const char *frames_pool_size_name() { return "frames_pool_size"; } |
|
|
static CfgParam create_frames_pool_size(size_t value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static constexpr const char *acceleration_mode_name() { return "mfxImplDescription.AccelerationMode"; } |
|
|
static CfgParam create_acceleration_mode(uint32_t value); |
|
|
static CfgParam create_acceleration_mode(const char* value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static constexpr const char *decoder_id_name() { return "mfxImplDescription.mfxDecoderDescription.decoder.CodecID"; } |
|
|
static CfgParam create_decoder_id(uint32_t value); |
|
|
static CfgParam create_decoder_id(const char* value); |
|
|
|
|
|
static constexpr const char *implementation_name() { return "mfxImplDescription.Impl"; } |
|
|
static CfgParam create_implementation(uint32_t value); |
|
|
static CfgParam create_implementation(const char* value); |
|
|
|
|
|
|
|
|
static constexpr const char *vpp_frames_pool_size_name() { return "vpp_frames_pool_size"; } |
|
|
static CfgParam create_vpp_frames_pool_size(size_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_width_name() { return "vpp.In.Width"; } |
|
|
static CfgParam create_vpp_in_width(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_height_name() { return "vpp.In.Height"; } |
|
|
static CfgParam create_vpp_in_height(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_crop_x_name() { return "vpp.In.CropX"; } |
|
|
static CfgParam create_vpp_in_crop_x(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_crop_y_name() { return "vpp.In.CropY"; } |
|
|
static CfgParam create_vpp_in_crop_y(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_crop_w_name() { return "vpp.In.CropW"; } |
|
|
static CfgParam create_vpp_in_crop_w(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_in_crop_h_name() { return "vpp.In.CropH"; } |
|
|
static CfgParam create_vpp_in_crop_h(uint16_t value); |
|
|
|
|
|
|
|
|
static constexpr const char *vpp_out_fourcc_name() { return "vpp.Out.FourCC"; } |
|
|
static CfgParam create_vpp_out_fourcc(uint32_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_chroma_format_name() { return "vpp.Out.ChromaFormat"; } |
|
|
static CfgParam create_vpp_out_chroma_format(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_width_name() { return "vpp.Out.Width"; } |
|
|
static CfgParam create_vpp_out_width(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_height_name() { return "vpp.Out.Height"; } |
|
|
static CfgParam create_vpp_out_height(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_crop_x_name() { return "vpp.Out.CropX"; } |
|
|
static CfgParam create_vpp_out_crop_x(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_crop_y_name() { return "vpp.Out.CropY"; } |
|
|
static CfgParam create_vpp_out_crop_y(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_crop_w_name() { return "vpp.Out.CropW"; } |
|
|
static CfgParam create_vpp_out_crop_w(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_crop_h_name() { return "vpp.Out.CropH"; } |
|
|
static CfgParam create_vpp_out_crop_h(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_pic_struct_name() { return "vpp.Out.PicStruct"; } |
|
|
static CfgParam create_vpp_out_pic_struct(uint16_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_framerate_n_name() { return "vpp.Out.FrameRateExtN"; } |
|
|
static CfgParam create_vpp_out_framerate_n(uint32_t value); |
|
|
|
|
|
static constexpr const char *vpp_out_framerate_d_name() { return "vpp.Out.FrameRateExtD"; } |
|
|
static CfgParam create_vpp_out_framerate_d(uint32_t value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
static CfgParam create(const std::string& name, ValueType&& value, bool is_major = true) { |
|
|
CfgParam param(name, CfgParam::value_t(std::forward<ValueType>(value)), is_major); |
|
|
return param; |
|
|
} |
|
|
|
|
|
struct Priv; |
|
|
|
|
|
const name_t& get_name() const; |
|
|
const value_t& get_value() const; |
|
|
bool is_major() const; |
|
|
std::string to_string() const; |
|
|
|
|
|
bool operator==(const CfgParam& rhs) const; |
|
|
bool operator< (const CfgParam& rhs) const; |
|
|
bool operator!=(const CfgParam& rhs) const; |
|
|
|
|
|
CfgParam& operator=(const CfgParam& src); |
|
|
CfgParam& operator=(CfgParam&& src); |
|
|
CfgParam(const CfgParam& src); |
|
|
CfgParam(CfgParam&& src); |
|
|
~CfgParam(); |
|
|
private: |
|
|
CfgParam(const std::string& param_name, value_t&& param_value, bool is_major_param); |
|
|
std::shared_ptr<Priv> m_priv; |
|
|
}; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
#endif |
|
|
|