Changeset 180:ecf35790a355 in mediastreamer2
- Timestamp:
- Nov 27, 2008 3:47:06 PM (4 years ago)
- Branch:
- default
- Location:
- linphone
- Files:
-
- 5 edited
-
coreapi/linphonecore.c (modified) (5 diffs)
-
coreapi/linphonecore.h (modified) (1 diff)
-
mediastreamer2/include/mediastreamer2/mswebcam.h (modified) (1 diff)
-
mediastreamer2/src/nowebcam.c (modified) (7 diffs)
-
oRTP/src/rtpsession.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
linphone/coreapi/linphonecore.c
r178 r180 51 51 #define LOCAL_RING "rings/oldphone.wav" 52 52 /* same for remote ring (ringback)*/ 53 #define REMOTE_RING_FR "ringback.wav" 54 #define REMOTE_RING_US "ringback.wav" 53 #define REMOTE_RING "ringback.wav" 55 54 56 55 … … 385 384 linphone_core_set_ring(lc,tmpbuf); 386 385 387 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING _FR;386 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; 388 387 tmpbuf=lp_config_get_string(lc->config,"sound","remote_ring",tmpbuf); 389 388 if (access(tmpbuf,F_OK)==-1){ 390 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING _FR;389 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; 391 390 } 392 391 if (strstr(tmpbuf,".wav")==NULL){ 393 392 /* it currently uses old sound files, so replace them */ 394 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING _FR;395 } 396 linphone_core_set_ringback(lc, 0);393 tmpbuf=PACKAGE_SOUND_DIR "/" REMOTE_RING; 394 } 395 linphone_core_set_ringback(lc,tmpbuf); 397 396 check_sound_device(lc); 398 397 lc->sound_conf.latency=0; … … 1763 1762 } 1764 1763 1765 const char *linphone_core_get_ring( LinphoneCore *lc){1764 const char *linphone_core_get_ring(const LinphoneCore *lc){ 1766 1765 return lc->sound_conf.local_ring; 1767 1766 } … … 1787 1786 1788 1787 1789 void linphone_core_set_ringback(LinphoneCore *lc,RingBackType type){ 1790 switch(type){ 1791 case RINGBACK_TYPE_FR: 1792 lc->sound_conf.remote_ring=PACKAGE_SOUND_DIR "/" REMOTE_RING_FR; 1793 break; 1794 case RINGBACK_TYPE_US: 1795 lc->sound_conf.remote_ring=PACKAGE_SOUND_DIR "/" REMOTE_RING_US; 1796 break; 1797 } 1798 } 1799 RingBackType linphone_core_get_ringback(LinphoneCore *lc); 1788 void linphone_core_set_ringback(LinphoneCore *lc, const char *path){ 1789 if (lc->sound_conf.remote_ring!=0){ 1790 ms_free(lc->sound_conf.remote_ring); 1791 } 1792 lc->sound_conf.remote_ring=ms_strdup(path); 1793 } 1794 1795 const char * linphone_core_get_ringback(const LinphoneCore *lc){ 1796 return lc->sound_conf.remote_ring; 1797 } 1800 1798 1801 1799 void linphone_core_enable_echo_cancelation(LinphoneCore *lc, bool_t val){ … … 2226 2224 lp_config_set_int(lc->config,"sound","echocancelation",config->ec); 2227 2225 if (config->local_ring) ms_free(config->local_ring); 2226 if (config->remote_ring) ms_free(config->remote_ring); 2228 2227 } 2229 2228 -
linphone/coreapi/linphonecore.h
r177 r180 653 653 void linphone_core_set_sound_source(LinphoneCore *lc, char source); 654 654 void linphone_core_set_ring(LinphoneCore *lc, const char *path); 655 const char *linphone_core_get_ring(LinphoneCore *lc); 655 const char *linphone_core_get_ring(const LinphoneCore *lc); 656 void linphone_core_set_ringback(LinphoneCore *lc, const char *path); 657 const char * linphone_core_get_ringback(const LinphoneCore *lc); 656 658 int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata); 657 typedef enum {RINGBACK_TYPE_FR,RINGBACK_TYPE_US} RingBackType;658 void linphone_core_set_ringback(LinphoneCore *lc,RingBackType type);659 RingBackType linphone_core_get_ringback(LinphoneCore *lc);660 659 void linphone_core_enable_echo_cancelation(LinphoneCore *lc, bool_t val); 661 660 bool_t linphone_core_echo_cancelation_enabled(LinphoneCore *lc); -
linphone/mediastreamer2/include/mediastreamer2/mswebcam.h
r0 r180 218 218 /** @} */ 219 219 220 221 /*specific methods for static image:*/ 222 223 void ms_static_image_set_default_image(const char *path); 224 220 225 #ifdef __cplusplus 221 226 } -
linphone/mediastreamer2/src/nowebcam.c
r150 r180 97 97 } 98 98 99 100 99 101 #ifndef PACKAGE_DATA_DIR 100 102 #define PACKAGE_DATA_DIR "." … … 104 106 #define NOWEBCAM_JPG "nowebcamCIF" 105 107 #endif 108 109 static char *def_image=NULL; 110 111 static const char *def_image_path=PACKAGE_DATA_DIR "/images/" NOWEBCAM_JPG ".jpg"; 112 106 113 107 114 mblk_t *ms_load_nowebcam(MSVideoSize *reqsize, int idx){ … … 116 123 typedef struct _SIData{ 117 124 MSVideoSize vsize; 118 char nowebcamimage[256]; 119 int index; 125 char *nowebcamimage; 120 126 uint64_t lasttime; 121 127 mblk_t *pic; … … 126 132 d->vsize.width=MS_VIDEO_SIZE_CIF_W; 127 133 d->vsize.height=MS_VIDEO_SIZE_CIF_H; 128 memset(d->nowebcamimage, 0, sizeof(d->nowebcamimage)); 129 d->index=-1; 134 135 if (def_image==NULL) 136 def_image=ms_strdup(def_image_path); 137 138 d->nowebcamimage=ms_strdup(def_image); 130 139 d->lasttime=0; 131 140 d->pic=NULL; … … 140 149 SIData *d=(SIData*)f->data; 141 150 if (d->pic==NULL){ 142 if (d->nowebcamimage[0] != '\0') 143 d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); 144 else 145 d->pic=ms_load_nowebcam(&d->vsize,d->index); 151 d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); 146 152 } 147 153 } … … 190 196 static int static_image_set_image(MSFilter *f, void *arg){ 191 197 SIData *d=(SIData*)f->data; 192 char *image = (char *)arg; 193 ms_mutex_lock(&f->lock); 198 const char *image = (const char *)arg; 199 ms_filter_lock(f); 200 if (d->nowebcamimage) ms_free(d->nowebcamimage); 194 201 if (image!=NULL && image[0]!='\0') 195 snprintf(d->nowebcamimage, sizeof(d->nowebcamimage), "%s",image);202 d->nowebcamimage=ms_strdup(image); 196 203 else 197 d->nowebcamimage [0] = '\0';198 199 if (d->pic!=NULL) 204 d->nowebcamimage = def_image; 205 206 if (d->pic!=NULL){ 200 207 freemsg(d->pic); 201 202 //if (d->nowebcamimage[0] != '\0') 203 // d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); 204 //else 205 // d->pic=ms_load_nowebcam(&d->vsize,d->index); 206 ms_mutex_unlock(&f->lock); 208 d->pic=NULL; 209 } 210 211 ms_filter_unlock(f); 207 212 return 0; 208 213 } … … 258 263 } 259 264 265 void ms_static_image_set_default_image(const char *path){ 266 if (def_image!=NULL) 267 ms_free(def_image); 268 def_image=NULL; 269 if (path) 270 def_image=ms_strdup(path); 271 } -
linphone/oRTP/src/rtpsession.c
r0 r180 1365 1365 rtp_stats_reset(&session->rtp.stats); 1366 1366 rtp_session_resync(session); 1367 session->ssrc_set=FALSE; 1367 1368 } 1368 1369
Note: See TracChangeset
for help on using the changeset viewer.
