提交 d0870133 编写于 作者: J jp9000

rtmp-services: Add get_int_val hepler function

This is just for accessing a json object.  I should be using obs_data_t
for this instead of json directly, but it doesn't really matter.
上级 0d30d122
......@@ -54,6 +54,15 @@ static inline const char *get_string_val(json_t *service, const char *key)
return json_string_value(str_val);
}
static inline int get_int_val(json_t *service, const char *key)
{
json_t *integer_val = json_object_get(service, key);
if (!integer_val || !json_is_integer(integer_val))
return 0;
return (int)json_integer_value(integer_val);
}
static inline bool get_bool_val(json_t *service, const char *key)
{
json_t *bool_val = json_object_get(service, key);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册