Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
c384b0b3
Commit
c384b0b3
authored
Sep 09, 2014
by
Sylvain Berfini
Browse files
Started Java impl of file transfer
parent
b2ae9095
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
143 additions
and
8 deletions
+143
-8
coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java
...java/org/linphone/core/tutorials/TutorialBuddyStatus.java
+7
-0
coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java
...lp/java/org/linphone/core/tutorials/TutorialChatRoom.java
+7
-0
coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java
.../java/org/linphone/core/tutorials/TutorialHelloWorld.java
+7
-0
coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java
...ava/org/linphone/core/tutorials/TutorialRegistration.java
+7
-0
coreapi/linphonecore.c
coreapi/linphonecore.c
+4
-0
coreapi/linphonecore.h
coreapi/linphonecore.h
+7
-0
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+21
-0
java/common/org/linphone/core/LinphoneChatMessage.java
java/common/org/linphone/core/LinphoneChatMessage.java
+8
-5
java/common/org/linphone/core/LinphoneChatRoom.java
java/common/org/linphone/core/LinphoneChatRoom.java
+23
-0
java/common/org/linphone/core/LinphoneCore.java
java/common/org/linphone/core/LinphoneCore.java
+12
-1
java/common/org/linphone/core/LinphoneCoreListener.java
java/common/org/linphone/core/LinphoneCoreListener.java
+9
-1
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
+19
-0
java/impl/org/linphone/core/LinphoneCoreImpl.java
java/impl/org/linphone/core/LinphoneCoreImpl.java
+12
-1
No files found.
coreapi/help/java/org/linphone/core/tutorials/TutorialBuddyStatus.java
View file @
c384b0b3
...
...
@@ -300,5 +300,12 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
}
@Override
public
void
fileTransferProgressIndication
(
LinphoneCore
lc
,
LinphoneChatMessage
message
,
LinphoneContent
content
,
int
progress
)
{
// TODO Auto-generated method stub
}
}
coreapi/help/java/org/linphone/core/tutorials/TutorialChatRoom.java
View file @
c384b0b3
...
...
@@ -218,5 +218,12 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
}
@Override
public
void
fileTransferProgressIndication
(
LinphoneCore
lc
,
LinphoneChatMessage
message
,
LinphoneContent
content
,
int
progress
)
{
// TODO Auto-generated method stub
}
}
coreapi/help/java/org/linphone/core/tutorials/TutorialHelloWorld.java
View file @
c384b0b3
...
...
@@ -220,5 +220,12 @@ public class TutorialHelloWorld implements LinphoneCoreListener {
}
@Override
public
void
fileTransferProgressIndication
(
LinphoneCore
lc
,
LinphoneChatMessage
message
,
LinphoneContent
content
,
int
progress
)
{
// TODO Auto-generated method stub
}
}
coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java
View file @
c384b0b3
...
...
@@ -251,6 +251,13 @@ public class TutorialRegistration implements LinphoneCoreListener {
}
@Override
public
void
fileTransferProgressIndication
(
LinphoneCore
lc
,
LinphoneChatMessage
message
,
LinphoneContent
content
,
int
progress
)
{
// TODO Auto-generated method stub
}
}
coreapi/linphonecore.c
View file @
c384b0b3
...
...
@@ -6399,6 +6399,10 @@ void linphone_core_set_file_transfer_server(LinphoneCore *core, const char * ser
core
->
file_transfer_server
=
ms_strdup
(
server_url
);
}
const
char
*
linphone_core_get_file_transfer_server
(
LinphoneCore
*
core
)
{
return
core
->
file_transfer_server
;
}
/**
* This function controls signaling features supported by the core.
* They are typically included in a SIP Supported header.
...
...
coreapi/linphonecore.h
View file @
c384b0b3
...
...
@@ -2854,6 +2854,13 @@ LINPHONE_PUBLIC void linphone_core_set_tone(LinphoneCore *lc, LinphoneToneID id,
* */
LINPHONE_PUBLIC
void
linphone_core_set_file_transfer_server
(
LinphoneCore
*
core
,
const
char
*
server_url
);
/**
* Get the globaly set http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml.
* @param[in] core #LinphoneCore from which to get the server_url
* @return URL of the file server like https://file.linphone.org/upload.php
* */
LINPHONE_PUBLIC
const
char
*
linphone_core_get_file_transfer_server
(
LinphoneCore
*
core
);
/**
* Returns a null terminated table of strings containing the file format extension supported for call recording.
* @param core the core
...
...
coreapi/linphonecore_jni.cc
View file @
c384b0b3
...
...
@@ -208,6 +208,7 @@ public:
vTable
.
notify_received
=
notifyReceived
;
vTable
.
publish_state_changed
=
publishStateChanged
;
vTable
.
configuring_status
=
configuringStatus
;
vTable
.
file_transfer_progress_indication
=
fileTransferProgressIndication
;
listenerClass
=
(
jclass
)
env
->
NewGlobalRef
(
env
->
GetObjectClass
(
alistener
));
...
...
@@ -310,6 +311,8 @@ public:
configuringStateId
=
env
->
GetMethodID
(
listenerClass
,
"configuringStatus"
,
"(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneCore$RemoteProvisioningState;Ljava/lang/String;)V"
);
configuringStateClass
=
(
jclass
)
env
->
NewGlobalRef
(
env
->
FindClass
(
"org/linphone/core/LinphoneCore$RemoteProvisioningState"
));
configuringStateFromIntId
=
env
->
GetStaticMethodID
(
configuringStateClass
,
"fromInt"
,
"(I)Lorg/linphone/core/LinphoneCore$RemoteProvisioningState;"
);
fileTransferProgressIndicationId
=
env
->
GetMethodID
(
listenerClass
,
"fileTransferProgressIndication"
,
"(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneContent;I)V"
);
}
~
LinphoneCoreData
()
{
...
...
@@ -417,6 +420,8 @@ public:
jclass
subscriptionDirClass
;
jmethodID
subscriptionDirFromIntId
;
jmethodID
fileTransferProgressIndicationId
;
LinphoneCoreVTable
vTable
;
static
void
showInterfaceCb
(
LinphoneCore
*
lc
)
{
...
...
@@ -792,6 +797,22 @@ public:
LinphoneCoreData
*
lcData
=
(
LinphoneCoreData
*
)
linphone_core_get_user_data
(
lc
);
env
->
CallVoidMethod
(
lcData
->
listener
,
lcData
->
configuringStateId
,
lcData
->
core
,
env
->
CallStaticObjectMethod
(
lcData
->
configuringStateClass
,
lcData
->
configuringStateFromIntId
,(
jint
)
status
),
message
?
env
->
NewStringUTF
(
message
)
:
NULL
);
}
static
void
fileTransferProgressIndication
(
LinphoneCore
*
lc
,
LinphoneChatMessage
*
message
,
const
LinphoneContent
*
content
,
size_t
progress
)
{
JNIEnv
*
env
=
0
;
jint
result
=
jvm
->
AttachCurrentThread
(
&
env
,
NULL
);
if
(
result
!=
0
)
{
ms_error
(
"cannot attach VM"
);
return
;
}
LinphoneCoreData
*
lcData
=
(
LinphoneCoreData
*
)
linphone_core_get_user_data
(
lc
);
env
->
CallVoidMethod
(
lcData
->
listener
,
lcData
->
fileTransferProgressIndicationId
,
lcData
->
core
,
message
?
env
->
NewObject
(
lcData
->
chatMessageClass
,
lcData
->
chatMessageCtrId
,
(
jlong
)
message
)
:
NULL
,
content
?
create_java_linphone_content
(
env
,
content
)
:
NULL
,
progress
);
}
};
extern
"C"
jlong
Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore
(
JNIEnv
*
env
...
...
java/common/org/linphone/core/LinphoneChatMessage.java
View file @
c384b0b3
...
...
@@ -14,21 +14,25 @@ public interface LinphoneChatMessage {
private
final
String
mStringValue
;
/**
* I
dl
e
* I
nitial stat
e
*/
public
final
static
State
Idle
=
new
State
(
0
,
"Idle"
);
/**
*
Incoming call received.
*
Delivery in progress
*/
public
final
static
State
InProgress
=
new
State
(
1
,
"InProgress"
);
/**
*
Outgoing call initialiazed.
*
Message succesffully delivered an acknoleged by remote end point
*/
public
final
static
State
Delivered
=
new
State
(
2
,
"Delivered"
);
/**
*
Outgoing call in progress.
*
Message was not delivered
*/
public
final
static
State
NotDelivered
=
new
State
(
3
,
"NotDelivered"
);
/**
* Message was received(and acknowledged) but cannot get file from server
*/
public
final
static
State
FileTransferError
=
new
State
(
4
,
"FileTransferError"
);
private
State
(
int
value
,
String
stringValue
)
{
mValue
=
value
;
...
...
@@ -153,5 +157,4 @@ public interface LinphoneChatMessage {
* @return an ErrorInfo.
*/
ErrorInfo
getErrorInfo
();
}
java/common/org/linphone/core/LinphoneChatRoom.java
View file @
c384b0b3
...
...
@@ -33,11 +33,13 @@ public interface LinphoneChatRoom {
* @return LinphoneAddress peer address
*/
LinphoneAddress
getPeerAddress
();
/**
* send a message to peer member of this chat room.
* @param message to be sent
*/
void
sendMessage
(
String
message
);
/**
* Send a message to peer member of this chat room.
* @param chat message
...
...
@@ -128,9 +130,30 @@ public interface LinphoneChatRoom {
* @return LinphoneChatMessage object
*/
LinphoneChatMessage
createLinphoneChatMessage
(
String
message
,
String
url
,
State
state
,
long
timestamp
,
boolean
isRead
,
boolean
isIncoming
);
/**
* Returns a back pointer to the core managing the chat room.
* @return the LinphoneCore
*/
LinphoneCore
getCore
();
/**
* Create a message attached to a dedicated chat room with a particular content.
* @param content LinphoneContent initial content.
* @return a new LinphoneChatMessage
*/
LinphoneChatMessage
createFileTransferMessage
(
LinphoneContent
content
);
/**
* Cancel an ongoing file transfer attached to this message (upload or download)
* @param message
*/
void
cancelFileTransfer
(
LinphoneChatMessage
message
);
/**
* Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer)
* @param message
* @return a pointer to the LinphoneContent structure or NULL if not present.
*/
LinphoneContent
getFileTransferInformation
(
LinphoneChatMessage
message
);
}
java/common/org/linphone/core/LinphoneCore.java
View file @
c384b0b3
...
...
@@ -18,7 +18,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package
org.linphone.core
;
import
java.util.List
;
import
java.util.Vector
;
import
org.linphone.mediastream.video.AndroidVideoWindowImpl
;
...
...
@@ -1695,4 +1694,16 @@ public interface LinphoneCore {
* @param value the jitter buffer size in milliseconds.
*/
public
void
setVideoJittcomp
(
int
value
);
/**
* Globaly set an http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml.
* @param serverUrl URL of the file server like https://file.linphone.org/upload.php
*/
public
void
setFileTransferServer
(
String
serverUrl
);
/**
* Get the globaly set http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml.
* @return the serverUrl
*/
public
String
getFileTransferServer
();
}
java/common/org/linphone/core/LinphoneCoreListener.java
View file @
c384b0b3
...
...
@@ -188,6 +188,14 @@ public interface LinphoneCoreListener {
/** @Deprecated Callback to display a warning to the user
* @return */
void
displayWarning
(
LinphoneCore
lc
,
String
message
);
/**
* Callback to be notified about the transfer progress.
* @param lc the LinphoneCore
* @param message the LinphoneChatMessage
* @param content the LinphoneContent
* @param progress percentage of the transfer done
*/
void
fileTransferProgressIndication
(
LinphoneCore
lc
,
LinphoneChatMessage
message
,
LinphoneContent
content
,
int
progress
);
}
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
View file @
c384b0b3
...
...
@@ -168,4 +168,23 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
return
messages
;
}
@Override
public
LinphoneChatMessage
createFileTransferMessage
(
LinphoneContent
content
)
{
// TODO Auto-generated method stub
return
null
;
}
@Override
public
void
cancelFileTransfer
(
LinphoneChatMessage
message
)
{
// TODO Auto-generated method stub
}
@Override
public
LinphoneContent
getFileTransferInformation
(
LinphoneChatMessage
message
)
{
// TODO Auto-generated method stub
return
null
;
}
}
java/impl/org/linphone/core/LinphoneCoreImpl.java
View file @
c384b0b3
...
...
@@ -22,7 +22,6 @@ import static android.media.AudioManager.MODE_IN_CALL;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.List
;
import
org.linphone.core.LinphoneCall.State
;
import
org.linphone.mediastream.Log
;
...
...
@@ -1241,5 +1240,17 @@ class LinphoneCoreImpl implements LinphoneCore {
public
synchronized
void
setVideoJittcomp
(
int
value
)
{
setVideoJittcomp
(
nativePtr
,
value
);
}
@Override
public
void
setFileTransferServer
(
String
serverUrl
)
{
// TODO Auto-generated method stub
}
@Override
public
String
getFileTransferServer
()
{
// TODO Auto-generated method stub
return
null
;
}
}
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