mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Removed user agent header from msi and updated travis build stuff
This commit is contained in:
parent
fb757bcd49
commit
efb070df9f
30
.travis.yml
30
.travis.yml
|
@ -13,42 +13,14 @@ before_script:
|
||||||
- make check -j3 > /dev/null
|
- make check -j3 > /dev/null
|
||||||
- sudo make install >/dev/null
|
- sudo make install >/dev/null
|
||||||
- cd ..
|
- cd ..
|
||||||
#installing libconfig, needed for DHT_bootstrap_daemon
|
|
||||||
#- wget http://www.hyperrealm.com/libconfig/libconfig-1.4.9.tar.gz > /dev/null
|
|
||||||
#- tar -xvzf libconfig-1.4.9.tar.gz > /dev/null
|
|
||||||
#- cd libconfig-1.4.9
|
|
||||||
#- ./configure > /dev/null
|
|
||||||
#- make -j3 > /dev/null
|
|
||||||
#- sudo make install > /dev/null
|
|
||||||
#- cd ..
|
|
||||||
#installing libopus, needed for audio encoding/decoding
|
#installing libopus, needed for audio encoding/decoding
|
||||||
- wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz > /dev/null
|
- wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz > /dev/null
|
||||||
- tar xzvf opus-1.0.3.tar.gz > /dev/null
|
- tar xzf opus-1.0.3.tar.gz > /dev/null
|
||||||
- cd opus-1.0.3
|
- cd opus-1.0.3
|
||||||
- ./configure > /dev/null
|
- ./configure > /dev/null
|
||||||
- make -j3 > /dev/null
|
- make -j3 > /dev/null
|
||||||
- sudo make install > /dev/null
|
- sudo make install > /dev/null
|
||||||
- cd ..
|
- cd ..
|
||||||
#installing libsdl1.2, needed for displaying video frames
|
|
||||||
#- wget http://www.libsdl.org/release/SDL-1.2.15.tar.gz > /dev/null
|
|
||||||
#- tar -xvzf SDL-1.2.15.tar.gz > /dev/null
|
|
||||||
#- cd SDL-1.2.15
|
|
||||||
#- ./configure > /dev/null
|
|
||||||
#- make -j3 /dev/null
|
|
||||||
#- sudo make install > /dev/null
|
|
||||||
#- cd ..
|
|
||||||
#installing libopenal, needed for audio capture/playback
|
|
||||||
#- sudo apt-get install libopenal-dev > /dev/null
|
|
||||||
#installing yasm, needed for compiling ffmpeg
|
|
||||||
- sudo apt-get install yasm > /dev/null
|
|
||||||
#installing ffmpeg, needed for capturing and encoding/decoding video
|
|
||||||
#- wget https://www.ffmpeg.org/releases/ffmpeg-2.0.2.tar.gz > /dev/null
|
|
||||||
#- tar -xvzf ffmpeg-2.0.2.tar.gz > /dev/null
|
|
||||||
#- cd ffmpeg-2.0.2
|
|
||||||
#- ./configure > /dev/null
|
|
||||||
#- make -j3 >/dev/null
|
|
||||||
#- sudo make install > /dev/null
|
|
||||||
#- cd ..
|
|
||||||
#installing vpx
|
#installing vpx
|
||||||
- git clone http://git.chromium.org/webm/libvpx.git > /dev/null
|
- git clone http://git.chromium.org/webm/libvpx.git > /dev/null
|
||||||
- cd libvpx
|
- cd libvpx
|
||||||
|
|
|
@ -89,7 +89,7 @@ Then clone this repo and generate makefile:
|
||||||
git clone git://github.com/irungentoo/ProjectTox-Core.git
|
git clone git://github.com/irungentoo/ProjectTox-Core.git
|
||||||
cd ProjectTox-Core
|
cd ProjectTox-Core
|
||||||
autoreconf -i
|
autoreconf -i
|
||||||
./configure --with-dependency-search=`pwd`/../ffmpeg/install
|
./configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
```
|
```
|
||||||
|
@ -321,7 +321,11 @@ cd ..
|
||||||
|
|
||||||
You are now ready to compile with phone!
|
You are now ready to compile with phone!
|
||||||
|
|
||||||
|
Note: Don't forget to run core configure like so:
|
||||||
|
```bash
|
||||||
|
./configure --with-dependency-search=`pwd`/../ffmpeg/install
|
||||||
|
```
|
||||||
|
before compiling the phone.
|
||||||
|
|
||||||
|
|
||||||
<a name="bootstrapd" />
|
<a name="bootstrapd" />
|
||||||
|
|
14
toxav/msi.c
14
toxav/msi.c
|
@ -84,7 +84,6 @@ GENERIC_HEADER ( Version )
|
||||||
GENERIC_HEADER ( Request )
|
GENERIC_HEADER ( Request )
|
||||||
GENERIC_HEADER ( Response )
|
GENERIC_HEADER ( Response )
|
||||||
GENERIC_HEADER ( CallType )
|
GENERIC_HEADER ( CallType )
|
||||||
GENERIC_HEADER ( UserAgent )
|
|
||||||
GENERIC_HEADER ( CallId )
|
GENERIC_HEADER ( CallId )
|
||||||
GENERIC_HEADER ( Info )
|
GENERIC_HEADER ( Info )
|
||||||
GENERIC_HEADER ( Reason )
|
GENERIC_HEADER ( Reason )
|
||||||
|
@ -103,7 +102,6 @@ typedef struct _MSIMessage {
|
||||||
MSIHeaderRequest request;
|
MSIHeaderRequest request;
|
||||||
MSIHeaderResponse response;
|
MSIHeaderResponse response;
|
||||||
MSIHeaderCallType calltype;
|
MSIHeaderCallType calltype;
|
||||||
MSIHeaderUserAgent useragent;
|
|
||||||
MSIHeaderInfo info;
|
MSIHeaderInfo info;
|
||||||
MSIHeaderReason reason;
|
MSIHeaderReason reason;
|
||||||
MSIHeaderCallId callid;
|
MSIHeaderCallId callid;
|
||||||
|
@ -128,7 +126,6 @@ static MSICallback callbacks[10] = {0};
|
||||||
#define INFO_FIELD "INFO"
|
#define INFO_FIELD "INFO"
|
||||||
#define REASON_FIELD "Reason"
|
#define REASON_FIELD "Reason"
|
||||||
#define CALLTYPE_FIELD "Call-type"
|
#define CALLTYPE_FIELD "Call-type"
|
||||||
#define USERAGENT_FIELD "User-agent"
|
|
||||||
#define CALLID_FIELD "Call-id"
|
#define CALLID_FIELD "Call-id"
|
||||||
#define CRYPTOKEY_FIELD "Crypto-key"
|
#define CRYPTOKEY_FIELD "Crypto-key"
|
||||||
#define NONCE_FIELD "Nonce"
|
#define NONCE_FIELD "Nonce"
|
||||||
|
@ -277,9 +274,8 @@ int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10: { /* User-agent, Crypto-key headers */
|
case 10: { /* Crypto-key headers */
|
||||||
if ON_HEADER ( _it, msg->useragent, USERAGENT_FIELD, 10 )
|
if ON_HEADER ( _it, msg->cryptokey, CRYPTOKEY_FIELD, 10 )
|
||||||
else if ON_HEADER ( _it, msg->cryptokey, CRYPTOKEY_FIELD, 10 )
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -315,7 +311,6 @@ void free_message ( MSIMessage *msg )
|
||||||
free ( msg->calltype.header_value );
|
free ( msg->calltype.header_value );
|
||||||
free ( msg->request.header_value );
|
free ( msg->request.header_value );
|
||||||
free ( msg->response.header_value );
|
free ( msg->response.header_value );
|
||||||
free ( msg->useragent.header_value );
|
|
||||||
free ( msg->version.header_value );
|
free ( msg->version.header_value );
|
||||||
free ( msg->info.header_value );
|
free ( msg->info.header_value );
|
||||||
free ( msg->cryptokey.header_value );
|
free ( msg->cryptokey.header_value );
|
||||||
|
@ -484,7 +479,6 @@ uint16_t message_to_string ( MSIMessage *msg, uint8_t *dest )
|
||||||
CLEAN_ASSIGN ( _size, _iterated, REQUEST_FIELD, msg->request );
|
CLEAN_ASSIGN ( _size, _iterated, REQUEST_FIELD, msg->request );
|
||||||
CLEAN_ASSIGN ( _size, _iterated, RESPONSE_FIELD, msg->response );
|
CLEAN_ASSIGN ( _size, _iterated, RESPONSE_FIELD, msg->response );
|
||||||
CLEAN_ASSIGN ( _size, _iterated, CALLTYPE_FIELD, msg->calltype );
|
CLEAN_ASSIGN ( _size, _iterated, CALLTYPE_FIELD, msg->calltype );
|
||||||
CLEAN_ASSIGN ( _size, _iterated, USERAGENT_FIELD, msg->useragent );
|
|
||||||
CLEAN_ASSIGN ( _size, _iterated, INFO_FIELD, msg->info );
|
CLEAN_ASSIGN ( _size, _iterated, INFO_FIELD, msg->info );
|
||||||
CLEAN_ASSIGN ( _size, _iterated, CALLID_FIELD, msg->callid );
|
CLEAN_ASSIGN ( _size, _iterated, CALLID_FIELD, msg->callid );
|
||||||
CLEAN_ASSIGN ( _size, _iterated, REASON_FIELD, msg->reason );
|
CLEAN_ASSIGN ( _size, _iterated, REASON_FIELD, msg->reason );
|
||||||
|
@ -505,7 +499,6 @@ void msi_msg_set_##header ( MSIMessage* _msg, const uint8_t* header_value, uint1
|
||||||
ALLOCATE_HEADER( _msg->header, header_value, _size )}
|
ALLOCATE_HEADER( _msg->header, header_value, _size )}
|
||||||
|
|
||||||
GENERIC_SETTER_DEFINITION ( calltype )
|
GENERIC_SETTER_DEFINITION ( calltype )
|
||||||
GENERIC_SETTER_DEFINITION ( useragent )
|
|
||||||
GENERIC_SETTER_DEFINITION ( reason )
|
GENERIC_SETTER_DEFINITION ( reason )
|
||||||
GENERIC_SETTER_DEFINITION ( info )
|
GENERIC_SETTER_DEFINITION ( info )
|
||||||
GENERIC_SETTER_DEFINITION ( callid )
|
GENERIC_SETTER_DEFINITION ( callid )
|
||||||
|
@ -1191,14 +1184,13 @@ void msi_register_callback ( MSICallback callback, MSICallbackID id )
|
||||||
* @return MSISession* The created session.
|
* @return MSISession* The created session.
|
||||||
* @retval NULL Error occured.
|
* @retval NULL Error occured.
|
||||||
*/
|
*/
|
||||||
MSISession *msi_init_session ( Messenger *messenger, const uint8_t *ua_name )
|
MSISession *msi_init_session ( Messenger* messenger )
|
||||||
{
|
{
|
||||||
assert ( messenger );
|
assert ( messenger );
|
||||||
|
|
||||||
MSISession *_retu = calloc ( sizeof ( MSISession ), 1 );
|
MSISession *_retu = calloc ( sizeof ( MSISession ), 1 );
|
||||||
assert ( _retu );
|
assert ( _retu );
|
||||||
|
|
||||||
_retu->ua_name = ua_name;
|
|
||||||
_retu->messenger_handle = messenger;
|
_retu->messenger_handle = messenger;
|
||||||
_retu->agent_handler = NULL;
|
_retu->agent_handler = NULL;
|
||||||
|
|
||||||
|
|
|
@ -103,8 +103,6 @@ typedef struct _MSISession {
|
||||||
int last_error_id; /* Determine the last error */
|
int last_error_id; /* Determine the last error */
|
||||||
const uint8_t *last_error_str;
|
const uint8_t *last_error_str;
|
||||||
|
|
||||||
const uint8_t *ua_name;
|
|
||||||
|
|
||||||
void *agent_handler; /* Pointer to an object that is handling msi */
|
void *agent_handler; /* Pointer to an object that is handling msi */
|
||||||
Messenger *messenger_handle;
|
Messenger *messenger_handle;
|
||||||
|
|
||||||
|
@ -152,11 +150,10 @@ void msi_register_callback(MSICallback callback, MSICallbackID id);
|
||||||
* @brief Start the control session.
|
* @brief Start the control session.
|
||||||
*
|
*
|
||||||
* @param messenger Tox* object.
|
* @param messenger Tox* object.
|
||||||
* @param user_agent User agent, i.e. 'Venom'; 'QT-gui'
|
|
||||||
* @return MSISession* The created session.
|
* @return MSISession* The created session.
|
||||||
* @retval NULL Error occured.
|
* @retval NULL Error occured.
|
||||||
*/
|
*/
|
||||||
MSISession *msi_init_session ( Messenger *messenger, const uint8_t *ua_name );
|
MSISession *msi_init_session ( Messenger *messenger );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1019,7 +1019,7 @@ av_session_t *av_init_session()
|
||||||
fraddr_to_str( _byte_address, _retu->_my_public_id );
|
fraddr_to_str( _byte_address, _retu->_my_public_id );
|
||||||
|
|
||||||
|
|
||||||
_retu->av = toxav_new(_retu->_messenger, _retu, _USERAGENT, width, height);
|
_retu->av = toxav_new(_retu->_messenger, _retu, width, height);
|
||||||
|
|
||||||
/* ------------------ */
|
/* ------------------ */
|
||||||
|
|
||||||
|
|
|
@ -75,14 +75,13 @@ typedef struct _ToxAv {
|
||||||
* it will result in undefined behaviour.
|
* it will result in undefined behaviour.
|
||||||
*
|
*
|
||||||
* @param messenger The messenger handle.
|
* @param messenger The messenger handle.
|
||||||
* @param useragent The agent handling A/V session (i.e. phone).
|
* @param userdata The agent handling A/V session (i.e. phone).
|
||||||
* @param ua_name Useragent name.
|
|
||||||
* @param video_width Width of video frame.
|
* @param video_width Width of video frame.
|
||||||
* @param video_height Height of video frame.
|
* @param video_height Height of video frame.
|
||||||
* @return ToxAv*
|
* @return ToxAv*
|
||||||
* @retval NULL On error.
|
* @retval NULL On error.
|
||||||
*/
|
*/
|
||||||
ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_t video_width, uint16_t video_height)
|
ToxAv *toxav_new( Tox *messenger, void *userdata, uint16_t video_width, uint16_t video_height)
|
||||||
{
|
{
|
||||||
ToxAv *av = calloc ( sizeof(ToxAv), 1);
|
ToxAv *av = calloc ( sizeof(ToxAv), 1);
|
||||||
|
|
||||||
|
@ -91,7 +90,7 @@ ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_
|
||||||
|
|
||||||
av->messenger = (Messenger *)messenger;
|
av->messenger = (Messenger *)messenger;
|
||||||
|
|
||||||
av->msi_session = msi_init_session(av->messenger, (const unsigned char *) ua_name );
|
av->msi_session = msi_init_session(av->messenger);
|
||||||
av->msi_session->agent_handler = av;
|
av->msi_session->agent_handler = av;
|
||||||
|
|
||||||
av->rtp_sessions[0] = av->rtp_sessions [1] = NULL;
|
av->rtp_sessions[0] = av->rtp_sessions [1] = NULL;
|
||||||
|
@ -102,7 +101,7 @@ ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_
|
||||||
av->cs = codec_init_session(AUDIO_BITRATE, AUDIO_FRAME_DURATION, AUDIO_SAMPLE_RATE, AUDIO_CHANNELS, video_width,
|
av->cs = codec_init_session(AUDIO_BITRATE, AUDIO_FRAME_DURATION, AUDIO_SAMPLE_RATE, AUDIO_CHANNELS, video_width,
|
||||||
video_height, VIDEO_BITRATE);
|
video_height, VIDEO_BITRATE);
|
||||||
|
|
||||||
av->agent_handler = useragent;
|
av->agent_handler = userdata;
|
||||||
|
|
||||||
return av;
|
return av;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,14 +110,13 @@ typedef enum {
|
||||||
* it will result in undefined behaviour.
|
* it will result in undefined behaviour.
|
||||||
*
|
*
|
||||||
* @param messenger The messenger handle.
|
* @param messenger The messenger handle.
|
||||||
* @param useragent The agent handling A/V session (i.e. phone).
|
* @param userdata The agent handling A/V session (i.e. phone).
|
||||||
* @param ua_name Useragent name.
|
|
||||||
* @param video_width Width of video frame.
|
* @param video_width Width of video frame.
|
||||||
* @param video_height Height of video frame.
|
* @param video_height Height of video frame.
|
||||||
* @return ToxAv*
|
* @return ToxAv*
|
||||||
* @retval NULL On error.
|
* @retval NULL On error.
|
||||||
*/
|
*/
|
||||||
ToxAv *toxav_new(Tox *messenger, void *useragent, const char *ua_name, uint16_t video_width, uint16_t video_height);
|
ToxAv *toxav_new(Tox* messenger, void* userdata, uint16_t video_width, uint16_t video_height);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Remove A/V session.
|
* @brief Remove A/V session.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user