Update coreapi to improve Android app

parent 0ce2d7cd
This diff is collapsed.
This diff is collapsed.
......@@ -68,7 +68,7 @@ typedef struct _LCSipTransports LCSipTransports;
* The LinphoneAddress has methods to extract and manipulate all parts of the address.
* When some part of the address (for example the username) is empty, the accessor methods
* return NULL.
*
*
* @ingroup linphone_address
* @var LinphoneAddress
*/
......@@ -128,7 +128,7 @@ typedef enum _LinphoneCallDir LinphoneCallDir;
* Enum representing the status of a call
* @ingroup call_logs
**/
typedef enum _LinphoneCallStatus {
typedef enum _LinphoneCallStatus {
LinphoneCallSuccess, /**< The call was sucessful*/
LinphoneCallAborted, /**< The call was aborted */
LinphoneCallMissed, /**< The call was missed (unanswered)*/
......@@ -139,7 +139,7 @@ typedef enum _LinphoneCallStatus {
* Structure representing a call log.
*
* @ingroup call_logs
*
*
**/
typedef struct _LinphoneCallLog{
LinphoneCallDir dir; /**< The direction of the call*/
......@@ -170,7 +170,7 @@ char * linphone_call_log_to_str(LinphoneCallLog *cl);
/**
* The LinphoneCallParams is an object containing various call related parameters.
* It can be used to retrieve parameters from a currently running call or modify the call's characteristics
* It can be used to retrieve parameters from a currently running call or modify the call's characteristics
* dynamically.
**/
struct _LinphoneCallParams;
......@@ -430,15 +430,15 @@ struct _LinphoneAuthInfo;
* different SIP domains.
*
* Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in
* order to become known and used automatically when needed.
* order to become known and used automatically when needed.
* Use linphone_core_add_auth_info() for that purpose.
*
* The LinphoneCore object can take the initiative to request authentication information
* when needed to the application through the auth_info_requested callback of the
* LinphoneCoreVTable structure.
*
* The application can respond to this information request later using
* linphone_core_add_auth_info(). This will unblock all pending authentication
* The application can respond to this information request later using
* linphone_core_add_auth_info(). This will unblock all pending authentication
* transactions and retry them with authentication headers.
*
**/
......@@ -833,7 +833,7 @@ const char * linphone_core_get_relay_addr(const LinphoneCore *lc);
int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr);
/* sound functions */
/* returns a null terminated static array of string describing the sound devices */
/* returns a null terminated static array of string describing the sound devices */
const char** linphone_core_get_sound_devices(LinphoneCore *lc);
bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device);
bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device);
......@@ -914,7 +914,7 @@ void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
/* returns a null terminated static array of string describing the webcams */
/* returns a null terminated static array of string describing the webcams */
const char** linphone_core_get_video_devices(const LinphoneCore *lc);
int linphone_core_set_video_device(LinphoneCore *lc, const char *id);
const char *linphone_core_get_video_device(const LinphoneCore *lc);
......@@ -934,6 +934,7 @@ unsigned long linphone_core_get_native_preview_window_id(const LinphoneCore *lc)
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id);
void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno);
void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation);
/*play/record support: use files instead of soundcard*/
void linphone_core_use_files(LinphoneCore *lc, bool_t yesno);
......@@ -1011,7 +1012,7 @@ LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
* force registration refresh to be initiated upon next iterate
* @ingroup proxies
*/
void linphone_core_refresh_registers(LinphoneCore* lc);
void linphone_core_refresh_registers(LinphoneCore* lc);
void linphone_call_send_vfu_request(LinphoneCall *call);
......
......@@ -20,8 +20,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "linphonecore_utils.h"
#include <ortp/zrtp.h>
extern "C" {
#include "mediastreamer2/mediastream.h"
}
#include "mediastreamer2/msjava.h"
#include "private.h"
#include <cpu-features.h>
#ifdef ANDROID
......@@ -1164,6 +1167,20 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv*
linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreviewWindowId(JNIEnv* env
,jobject thiz
,jlong lc
,jobject obj) {
linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDeviceRotation(JNIEnv* env
,jobject thiz
,jlong lc
,jint rotation) {
linphone_core_set_device_rotation((LinphoneCore*)lc,rotation);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, int enum_value){
linphone_core_set_firewall_policy((LinphoneCore*)lc,(LinphoneFirewallPolicy)enum_value);
......@@ -1267,7 +1284,7 @@ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setExpires(JNIEnv
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
linphone_call_get_duration((LinphoneCall *) ptr);
}
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) {
LCSipTransports tr;
linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr);
......@@ -1289,7 +1306,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSignalingTransportPor
tr.udp_port = udp;
tr.tcp_port = tcp;
tr.tls_port = tls;
linphone_core_set_sip_transports(lc, &tr); // tr will be copied
}
......@@ -1334,6 +1351,25 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIE
}
}
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_setVideoDevice(JNIEnv *env,jobject thiz,jlong pCore,jint id) {
LinphoneCore* lc = (LinphoneCore *) pCore;
const char** devices = linphone_core_get_video_devices(lc);
if (devices == NULL) {
ms_error("No existing video devices\n");
return -1;
}
int i;
for(i=0; i<=id; i++) {
if (devices[i] == NULL)
break;
ms_message("Existing device %d : %s\n", i, devices[i]);
if (i==id) {
return linphone_core_set_video_device(lc, devices[i]);
}
}
return -1;
}
extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getAuthenticationToken(JNIEnv* env,jobject thiz,jlong ptr) {
LinphoneCall *call = (LinphoneCall *) ptr;
const char* token = linphone_call_get_authentication_token(call);
......@@ -1356,4 +1392,3 @@ extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv* env,
msandroid_hack_speaker_state(speakerOn);
// End Galaxy S hack functions
}
......@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _PRIVATE_H
#define _PRIVATE_H
......@@ -34,11 +34,11 @@
#endif
#include "mediastreamer2/mediastream.h"
#ifndef LIBLINPHONE_VERSION
#ifndef LIBLINPHONE_VERSION
#define LIBLINPHONE_VERSION LINPHONE_VERSION
#endif
#ifndef PACKAGE_SOUND_DIR
#ifndef PACKAGE_SOUND_DIR
#define PACKAGE_SOUND_DIR "."
#endif
......@@ -247,7 +247,7 @@ struct _LinphoneProxyConfig
LinphoneReason error;
};
struct _LinphoneAuthInfo
struct _LinphoneAuthInfo
{
char *username;
char *realm;
......@@ -280,7 +280,7 @@ struct _LinphoneFriend{
bool_t subscribe_active;
bool_t inc_subscribe_pending;
bool_t commit;
};
};
typedef struct sip_config
......@@ -310,7 +310,7 @@ typedef struct rtp_config
int audio_jitt_comp; /*jitter compensation*/
int video_jitt_comp; /*jitter compensation*/
int nortp_timeout;
bool_t rtp_no_xmit_on_audio_mute;
bool_t rtp_no_xmit_on_audio_mute;
/* stop rtp xmit when audio muted */
}rtp_config_t;
......@@ -447,6 +447,7 @@ struct _LinphoneCore
bool_t auto_net_state_mon;
bool_t network_reachable;
bool_t use_preview_window;
int device_rotation;
bool_t ringstream_autorelease;
char* zrtp_secrets_cache;
};
......
......@@ -39,7 +39,7 @@ public interface LinphoneCall {
*/
IncomingReceived(1, "IncomingReceived"),
/**
* Outgoing call initialiazed.
* Outgoing call initialized.
*/
OutgoingInit(2, "OutgoingInit"),
/**
......
......@@ -474,6 +474,10 @@ public interface LinphoneCore {
void setVideoWindow(Object w);
void setPreviewWindow(Object w);
void setDeviceRotation(int rotation);
void setVideoDevice(int id);
/**
* Enables video globally.
*
......
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