Commit 40112833 authored by Ghislain MARY's avatar Ghislain MARY

Add linphone_video_definition_clone().

parent b6f74357
...@@ -206,7 +206,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition(const ...@@ -206,7 +206,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition(const
LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item); LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item);
if (linphone_video_definition_equals(svdef, searched_vdef)) { if (linphone_video_definition_equals(svdef, searched_vdef)) {
linphone_video_definition_unref(searched_vdef); linphone_video_definition_unref(searched_vdef);
return svdef; return linphone_video_definition_clone(svdef);
} }
} }
...@@ -220,7 +220,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_na ...@@ -220,7 +220,7 @@ LinphoneVideoDefinition * linphone_factory_find_supported_video_definition_by_na
for (item = supported; item != NULL; item = bctbx_list_next(item)) { for (item = supported; item != NULL; item = bctbx_list_next(item)) {
LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item); LinphoneVideoDefinition *svdef = (LinphoneVideoDefinition *)bctbx_list_get_data(item);
if (strcmp(linphone_video_definition_get_name(svdef), name) == 0) { if (strcmp(linphone_video_definition_get_name(svdef), name) == 0) {
return svdef; return linphone_video_definition_clone(svdef);
} }
} }
return NULL; return NULL;
......
...@@ -66,6 +66,9 @@ void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void ...@@ -66,6 +66,9 @@ void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void
vdef->user_data = ud; vdef->user_data = ud;
} }
LinphoneVideoDefinition * linphone_video_definition_clone(const LinphoneVideoDefinition *vdef) {
return linphone_video_definition_new(linphone_video_definition_get_width(vdef), linphone_video_definition_get_height(vdef), linphone_video_definition_get_name(vdef));
}
unsigned int linphone_video_definition_get_width(const LinphoneVideoDefinition *vdef) { unsigned int linphone_video_definition_get_width(const LinphoneVideoDefinition *vdef) {
return vdef->width; return vdef->width;
......
...@@ -61,6 +61,13 @@ LINPHONE_PUBLIC void *linphone_video_definition_get_user_data(const LinphoneVide ...@@ -61,6 +61,13 @@ LINPHONE_PUBLIC void *linphone_video_definition_get_user_data(const LinphoneVide
**/ **/
LINPHONE_PUBLIC void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void *ud); LINPHONE_PUBLIC void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void *ud);
/**
* Clone a video definition.
* @param[in] vdef LinphoneVideoDefinition object to be cloned
* @return The new clone of the video definition
*/
LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_video_definition_clone(const LinphoneVideoDefinition *vdef);
/** /**
* Get the width of the video definition. * Get the width of the video definition.
* @param[in] vdef LinphoneVideoDefinition object * @param[in] vdef LinphoneVideoDefinition object
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment