Commit fb250ab7 authored by Guillaume Beraudo's avatar Guillaume Beraudo
Browse files

Added bindings to linphoneCore: video size, bandwidth...

Declared Java counterpart for VideoSize object.
parent 78c6a9d0
......@@ -1001,4 +1001,29 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateAddressWithParams(
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){
return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params);
\ No newline at end of file
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc, jint width, jint height){
MSVideoSize vsize;
vsize.width = (int)width;
vsize.height = (int)height;
linphone_core_set_preferred_video_size((LinphoneCore *)lc, vsize);
extern "C" jintArray Java_org_linphone_core_LinphoneCoreImpl_getPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc){
MSVideoSize vsize = linphone_core_get_preferred_video_size((LinphoneCore *)lc);
jintArray arr = env->NewIntArray(2);
int tVsize [2]= {vsize.width,vsize.height};
env->SetIntArrayRegion(arr, 0, 2, tVsize);
return arr;
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDownloadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
linphone_core_set_download_bandwidth((LinphoneCore *)lc, (int) bw);
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
linphone_core_set_upload_bandwidth((LinphoneCore *)lc, (int) bw);
......@@ -89,10 +89,28 @@ public interface LinphoneCall {
* Call end
public final static State CallEnd = new State(13,"CallEnd");
* Paused by remote
public final static State PausedByRemote = new State(14,"PausedByRemote");
* The call's parameters are updated, used for example when video is asked by remote
public static final State CallUpdatedByRemote = new State(15, "CallUpdatedByRemote");
* We are proposing early media to an incoming call
public static final State CallIncomingEarlyMedia = new State(16,"CallIncomingEarlyMedia");
* The remote accepted the call update initiated by us
public static final State CallUpdated = new State(17, "CallUpdated");
private State(int value,String stringValue) {
mValue = value;
......@@ -26,7 +26,7 @@ package org.linphone.core;
public interface LinphoneCallParams {
void setVideoEnalbled(boolean b);
void setVideoEnabled(boolean b);
boolean getVideoEnabled();
LinphoneCallParams copy();
......@@ -461,4 +461,11 @@ public interface LinphoneCore {
public LinphoneCallParams createDefaultCallParameters();
public void setUploadBandwidth(int bw);
public void setDownloadBandwidth(int bw);
public void setPreferredVideoSize(VideoSize vSize);
public VideoSize getPreferredVideoSize();
Copyright (C) 2010 Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package org.linphone.core;
* @author Guillaume Beraudo
public final class VideoSize {
public static final int QCIF = 0;
public static final int CIF = 1;
public static final int HVGA = 2;
private int width;
public int getWidth() {return width;}
public void setWidth(int width) {this.width = width;}
private int height;
public int getHeight() {return height;}
public void setHeight(int height) {this.height = height;}
public VideoSize() {}
private VideoSize(int width, int height) {
this.width = width;
this.height = height;
public static final VideoSize createStandard(int code) {
switch (code) {
case QCIF:
return new VideoSize(176, 144);
case CIF:
return new VideoSize(352, 288);
case HVGA:
return new VideoSize(320, 480);
return new VideoSize(); // Invalid one
public boolean isValid() {
return width > 0 && height > 0;
// Generated
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + height;
result = prime * result + width;
return result;
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
VideoSize other = (VideoSize) obj;
if (height != other.height)
return false;
if (width != other.width)
return false;
return true;
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