]> sjero.net Git - linphone/commitdiff
add new command to set fps of static picture
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 3 Sep 2010 13:41:15 +0000 (15:41 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 3 Sep 2010 13:41:15 +0000 (15:41 +0200)
TODO
console/commands.c
coreapi/linphonecore.c
coreapi/linphonecore.h
mediastreamer2
oRTP

diff --git a/TODO b/TODO
index 3a0199c38a2b48a40be818cc954ae19d8dc9a293..1452a7c001bc022e7dfdb7180e497938f97d8b2d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,20 +3,12 @@ hot stuff:
 
 * ice support
 * run a user given command upon incoming calls
-* linphonec on win32
-* RTP inactivity timeout to close lost calls.
-
+* SIP/TLS and SRTP
 
 low priority:
 -------------
 
-* random RTP ports (to enable direct mapping NAT)
 * zeroconf support for advertising services (cool stuff!)
 * have the possibility to define several profiles (config files) and switch between them
-* display call duration
 * help tips for the registration box
-* The length (or duration) of the call could be displayed (see icons2.png)
 * 2. There could be a sound effect for "busy" - a short "beep-beep-beep" would be      sufficient (try http://www.google.com/search?q=busy.wav)
-* The call history could be a bit more clear (see history.png). And it
-  should be saved somewhere, so you can track your calls if you need to...
-* move resampling stuff to use speex instead of libresample.
\ No newline at end of file
index 2fd9b5401c341545c56d66da55f7c7d3ea50fc96..3abe0fb68637efd8990b96642c485bc110a118d7 100644 (file)
@@ -175,6 +175,7 @@ LPC_COMMAND commands[] = {
        },
        { "staticpic", lpc_cmd_staticpic, "Manage static pictures when nowebcam",
                "'staticpic set' : Set path to picture that should be used.\n"
+               "'staticpic fps' : Get/set frames per seconds for picture emission.\n"
        },
        { "ipv6", lpc_cmd_ipv6, "Use IPV6",
                "'ipv6 status' : show ipv6 usage status.\n"
@@ -1218,6 +1219,19 @@ lpc_cmd_staticpic(LinphoneCore *lc, char *args)
                return 1;
        }
 
+       if (strcmp(arg1, "fps")==0) {
+         if (arg2) {
+               float fps = atof(arg2); /* FIXME: Handle not-a-float */
+               linphone_core_set_static_picture_fps(lc, fps);
+               return 1;
+         } else {
+               float fps;
+               fps = linphone_core_get_static_picture_fps(lc);
+               linphonec_out("Current FPS %f\n", fps);
+               return 1;
+         }
+       }
+
        return 0; /* Syntax error */
 }
 
index af13e57a0f79ee86dcf0cdf19a2ec11c0bf368b6..145f670121015280076ebaa68207788b316147ee 100644 (file)
@@ -3106,8 +3106,8 @@ const char *linphone_core_get_video_device(const LinphoneCore *lc){
        return NULL;
 }
 
-int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
 #ifdef VIDEO_ENABLED
+static VideoStream * get_active_video_stream(LinphoneCore *lc){
        VideoStream *vs = NULL;
        LinphoneCall *call=linphone_core_get_current_call (lc);
        /* Select the video stream from the call in the first place */
@@ -3118,7 +3118,13 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
        if (vs == NULL && lc->previewstream) {
                vs = lc->previewstream;
        }
-       
+       return vs;
+}
+#endif
+
+int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
+#ifdef VIDEO_ENABLED
+       VideoStream *vs=get_active_video_stream(lc);
        /* 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. */
@@ -3128,7 +3134,6 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
                                                                                                                (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);
@@ -3138,6 +3143,48 @@ int linphone_core_set_static_picture(LinphoneCore *lc, const char *path) {
        return 0;
 }
 
+int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps) {
+#ifdef VIDEO_ENABLED
+       VideoStream *vs = NULL;
+
+       vs=get_active_video_stream(lc);
+       
+       /* 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_FPS,(void *)&fps);
+               }
+       }
+#else
+       ms_warning("Video support not compiled.");
+#endif
+       return 0;
+}
+
+float linphone_core_get_static_picture_fps(LinphoneCore *lc) {
+#ifdef VIDEO_ENABLED
+       VideoStream *vs = NULL;
+       vs=get_active_video_stream(lc);
+       /* 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) {
+                 
+                       float fps;
+                 
+                       ms_filter_call_method(vs->source, MS_FILTER_GET_FPS,(void *)&fps);
+                       return fps;
+               }
+       }
+#else
+       ms_warning("Video support not compiled.");
+#endif
+       return 0;
+}
+
 /**
  * Returns the native window handle of the video window, casted as an unsigned long.
  *
index 555d38cdff259ca18a4bbb51d608c50150e7433f..52247d902d94a131bbaad40e460b8bfe363fc687 100644 (file)
@@ -760,6 +760,10 @@ const char *linphone_core_get_video_device(const LinphoneCore *lc);
 /* Set static picture to be used when "Static picture" is the video device */
 int linphone_core_set_static_picture(LinphoneCore *lc, const char *path);
 
+/* Set and get frame rate for static picture */
+int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps);
+float linphone_core_get_static_picture_fps(LinphoneCore *lc);
+
 /*function to be used for eventually setting window decorations (icons, title...)*/
 unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc);
 
index ea7ca97aaaa6f191dfec112f137fb048a4ef2139..efe65efba0a5c434aa82ab4d3aaa6fec4e4c158c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ea7ca97aaaa6f191dfec112f137fb048a4ef2139
+Subproject commit efe65efba0a5c434aa82ab4d3aaa6fec4e4c158c
diff --git a/oRTP b/oRTP
index 534074027a2163694ce6f8a520f0d6f6ac82b15d..6bc540160a8729f63f6074b958161bc696e78f93 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d
+Subproject commit 6bc540160a8729f63f6074b958161bc696e78f93