mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-25 07:08:11 +00:00
add new command to set fps of static picture
This commit is contained in:
parent
5965a7ac64
commit
ae37e1404d
6 changed files with 71 additions and 14 deletions
10
TODO
10
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.
|
||||
|
|
@ -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 */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit ea7ca97aaaa6f191dfec112f137fb048a4ef2139
|
||||
Subproject commit efe65efba0a5c434aa82ab4d3aaa6fec4e4c158c
|
||||
2
oRTP
2
oRTP
|
|
@ -1 +1 @@
|
|||
Subproject commit 534074027a2163694ce6f8a520f0d6f6ac82b15d
|
||||
Subproject commit 6bc540160a8729f63f6074b958161bc696e78f93
|
||||
Loading…
Add table
Reference in a new issue