]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
Merge branch 'dev_sal'
[linphone] / coreapi / linphonecore.c
index dbdd77c26e58ea0089f0e2c43d3bcf1fcac78367..3e911cee1d730925eb8422afaa8d08ab41f1fe69 100644 (file)
@@ -1498,7 +1498,7 @@ static void monitor_network_state(LinphoneCore *lc, time_t curtime){
        static time_t last_check=0;
        static bool_t last_status=FALSE;
        char result[LINPHONE_IPADDR_SIZE];
-       bool_t new_status;
+       bool_t new_status=last_status;
 
        /* only do the network up checking every five seconds */
        if (last_check==0 || (curtime-last_check)>=5){
@@ -3044,6 +3044,35 @@ const char *linphone_core_get_video_device(const LinphoneCore *lc){
        return NULL;
 }
 
+int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
+       VideoStream *vs = NULL;
+
+       /* Select the video stream from the call in the first place */
+       if (lc && lc->videostream) {
+               vs = lc->videostream;
+       }
+       /* If not in call, select the video stream from the preview */
+       if (vs == NULL && lc && lc->previewstream) {
+               vs = lc->previewstream;
+       }
+       
+       /* If we have a video stream (either preview, either from call), we
+                have a source and it is using the static picture filter, then
+                force the filter to use that picture. */
+       if (vs && vs->source) {
+               if (ms_filter_get_id(vs->source) == MS_STATIC_IMAGE_ID) {
+                       ms_filter_call_method(vs->source, MS_FILTER_SET_IMAGE,
+                                                                                                               (void *)path);
+               }
+       }
+
+       /* Tell the static image filter to use that image from now on so
+                that the image will be used next time it has to be read */
+       ms_static_image_set_default_image(path);
+
+       return 0;
+}
+
 /**
  * Returns the native window handle of the video window, casted as an unsigned long.
  *