#ifndef __GSTGUI_TOOLKIT_H_ #define __GSTGUI_TOOLKIT_H_ #include #include #include #include namespace GstToolkit { typedef enum { TIME_STRING_FIXED = 0, TIME_STRING_ADJUSTED, TIME_STRING_MINIMAL, TIME_STRING_READABLE } time_string_mode; std::string time_to_string(guint64 t, time_string_mode m = TIME_STRING_ADJUSTED); std::string filename_to_uri(std::string filename); std::string gst_version(); std::list all_plugins(); std::list enable_gpu_decoding_plugins(bool enable = true); std::string used_gpu_decoding_plugins(GstElement *gstbin); std::string used_decoding_plugins(GstElement *gstbin); std::list all_plugin_features(const std::string &pluginname); bool has_feature (const std::string &name); bool enable_feature (const std::string &name, bool enable); struct PipelineConfig { gint width; gint height; gint fps_numerator; gint fps_denominator; std::string stream; std::string format; PipelineConfig() { width = 0; height = 0; fps_numerator = 30; fps_denominator = 1; stream = ""; format = ""; } inline bool operator < (const PipelineConfig b) const { int formatscore = this->format.find("R") != std::string::npos ? 2 : 1; // best score for RGBx int b_formatscore = b.format.find("R") != std::string::npos ? 2 : 1; float fps = static_cast(this->fps_numerator) / static_cast(this->fps_denominator); float b_fps = static_cast(b.fps_numerator) / static_cast(b.fps_denominator); return ( fps * static_cast(this->width * formatscore) < b_fps * static_cast(b.width * b_formatscore)); } }; struct better_config_comparator { inline bool operator () (const PipelineConfig a, const PipelineConfig b) const { return (a < b); } }; typedef std::set PipelineConfigSet; PipelineConfigSet getPipelineConfigs(const std::string &src_description); } #endif // __GSTGUI_TOOLKIT_H_