Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
107fb22c
Commit
107fb22c
authored
Oct 16, 2013
by
Sylvain Berfini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix XML2LPC and LPC2XML converters JNI log callbacks
parent
a216dc8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
tools/lpc2xml_jni.cc
tools/lpc2xml_jni.cc
+9
-4
tools/xml2lpc_jni.cc
tools/xml2lpc_jni.cc
+8
-3
No files found.
tools/lpc2xml_jni.cc
View file @
107fb22c
...
...
@@ -26,6 +26,7 @@ extern "C" {
#endif
#include <stdio.h>
#include "mediastreamer2/mscommon.h"
struct
jni_lpc2xml_ctx
{
JNIEnv
*
env
;
...
...
@@ -52,10 +53,14 @@ extern "C" void Java_org_linphone_tools_Lpc2Xml_callback (void *ctx, lpc2xml_log
char
buffer
[
LPC2XML_CALLBACK_BUFFER_SIZE
];
vsnprintf
(
buffer
,
LPC2XML_CALLBACK_BUFFER_SIZE
,
fmt
,
list
);
jstring
javaString
=
env
->
NewStringUTF
(
buffer
);
jint
javaLevel
=
level
;
my_jni
::
callVoidMethod
<
void
>
(
env
,
obj
,
"Lpc2Xml"
,
"printLog"
,
"(ILjava/lang/String;)V"
,
javaLevel
,
javaString
);
}
if
(
level
==
LPC2XML_ERROR
)
ms_error
(
"%s"
,
buffer
);
else
if
(
level
==
LPC2XML_WARNING
)
ms_warning
(
"%s"
,
buffer
);
else
ms_message
(
"%s"
,
buffer
);
}
}
extern
"C"
void
Java_org_linphone_tools_Lpc2Xml_init
(
JNIEnv
*
env
,
jobject
obj
)
{
...
...
tools/xml2lpc_jni.cc
View file @
107fb22c
...
...
@@ -26,6 +26,7 @@ extern "C" {
#endif
#include <stdio.h>
#include "mediastreamer2/mscommon.h"
struct
jni_xml2lpc_ctx
{
JNIEnv
*
env
;
...
...
@@ -52,9 +53,13 @@ extern "C" void Java_org_linphone_tools_Xml2Lpc_callback (void *ctx, xml2lpc_log
char
buffer
[
XML2LPC_CALLBACK_BUFFER_SIZE
];
vsnprintf
(
buffer
,
XML2LPC_CALLBACK_BUFFER_SIZE
,
fmt
,
list
);
jstring
javaString
=
env
->
NewStringUTF
(
buffer
);
jint
javaLevel
=
level
;
my_jni
::
callVoidMethod
<
void
>
(
env
,
obj
,
"Xml2Lpc"
,
"printLog"
,
"(ILjava/lang/String;)V"
,
javaLevel
,
javaString
);
if
(
level
==
XML2LPC_ERROR
)
ms_error
(
"%s"
,
buffer
);
else
if
(
level
==
XML2LPC_WARNING
)
ms_warning
(
"%s"
,
buffer
);
else
ms_message
(
"%s"
,
buffer
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment