Commit 4e8a4d28 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Revert "Update Cs wrapper for uwp"

This reverts commit d3c5e6b0.
parent f07419e9
......@@ -30,6 +30,13 @@
using namespace std;
static bool dirExists(const std::string& dirName) {
DWORD ftyp = GetFileAttributesA(dirName.c_str());
if (ftyp == INVALID_FILE_ATTRIBUTES) return false;
if (ftyp & FILE_ATTRIBUTE_DIRECTORY) return true;
return false;
}
LINPHONE_BEGIN_NAMESPACE
static string getPath (const GUID &id) {
......@@ -42,7 +49,9 @@ static string getPath (const GUID &id) {
CoTaskMemFree(path);
}
return strPath.append("/linphone/");
strPath = strPath.append("/linphone/");
if (!dirExists(strPath)) CreateDirectoryA(strPath.c_str(), nullptr);
return strPath;
}
......
......@@ -37,7 +37,7 @@ static void play_file(const char *filename, bool_t supported_format, const char
bool_t video_codec_supported = (video_mime && ms_factory_get_decoder(linphone_core_get_ms_factory((void *)lc_manager->lc), video_mime));
int expected_res = (supported_format && (audio_codec_supported || video_codec_supported)) ? 0 : -1;
player = linphone_core_create_local_player(lc_manager->lc, linphone_core_get_ringer_device(lc_manager->lc), video_stream_get_default_video_renderer(), 0);
player = linphone_core_create_local_player(lc_manager->lc, linphone_core_get_ringer_device(lc_manager->lc), video_stream_get_default_video_renderer(NULL), 0);
BC_ASSERT_PTR_NOT_NULL(player);
if(player == NULL) goto fail;
......
......@@ -207,7 +207,7 @@ namespace Linphone
{
break;
}
string key = Marshal.PtrToStringAuto(dataPtr);
string key = Marshal.PtrToStringAnsi(dataPtr);
yield return key;
ptr = bctbx_list_next(ptr);
}
......@@ -459,7 +459,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_call_get_native_video_window_id(nativePtr));
return Marshal.PtrToStringUni(linphone_call_get_native_video_window_id(nativePtr));
}
set
{
......@@ -487,7 +487,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_core_get_native_video_window_id(nativePtr));
return Marshal.PtrToStringUni(linphone_core_get_native_video_window_id(nativePtr));
}
set
{
......@@ -500,7 +500,7 @@ namespace Linphone
{
get
{
return Marshal.PtrToStringAuto(linphone_core_get_native_preview_window_id(nativePtr));
return Marshal.PtrToStringUni(linphone_core_get_native_preview_window_id(nativePtr));
}
set
{
......@@ -529,7 +529,7 @@ namespace Linphone
{
{{#is_string}}
IntPtr stringPtr = {{getter_c_name}}({{getter_nativePtr}});
return Marshal.PtrToStringAuto(stringPtr);
return Marshal.PtrToStringAnsi(stringPtr);
{{/is_string}}
{{#is_bool}}
return {{getter_c_name}}({{getter_nativePtr}}) != 0;
......@@ -607,14 +607,14 @@ namespace Linphone
cbs.unregister();
{{/removeListener}}
{{#is_string}}
IntPtr stringPtr = {{c_name}}({{nativePtr}}{{c_args}});
return Marshal.PtrToStringAuto(stringPtr);
IntPtr stringPtr = {{c_name}}({{nativePtr}}{{{c_args}}});
return Marshal.PtrToStringAnsi(stringPtr);
{{/is_string}}
{{#is_bool}}
{{return}}{{c_name}}({{nativePtr}}{{c_args}}) == (char)0 ? false : true;
{{return}}{{c_name}}({{nativePtr}}{{{c_args}}}) == (char)0 ? false : true;
{{/is_bool}}
{{#is_class}}
IntPtr ptr = {{c_name}}({{nativePtr}}{{c_args}});
IntPtr ptr = {{c_name}}({{nativePtr}}{{{c_args}}});
return fromNativePtr<{{type}}>(ptr, {{takeRef}});
{{/is_class}}
{{#is_enum}}
......@@ -626,10 +626,10 @@ namespace Linphone
{{#exception}}if (exception_result != 0) throw new LinphoneException("{{name}} returned value" + exception_result);{{/exception}}
{{/is_generic}}
{{#is_string_list}}
return MarshalStringArray({{c_name}}({{nativePtr}}{{c_args}}));
return MarshalStringArray({{c_name}}({{nativePtr}}{{{c_args}}}));
{{/is_string_list}}
{{#is_class_list}}
return MarshalBctbxList<{{{list_type}}}>({{c_name}}({{nativePtr}}{{c_args}}));
return MarshalBctbxList<{{{list_type}}}>({{c_name}}({{nativePtr}}{{{c_args}}}));
{{/is_class_list}}
}
{{/impl}}
......
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