Commit d99aa7d5 authored by François Grisez's avatar François Grisez
Browse files

x11video filter: drop all frames when the ticker is later than 100ms

parent f83a726f
......@@ -28,7 +28,7 @@ set(MEDIASTREAMER_MAJOR_VERSION "2")
set(MEDIASTREAMER_MINOR_VERSION "11")
set(MEDIASTREAMER_MICRO_VERSION "2")
set(MEDIASTREAMER_VERSION "${MEDIASTREAMER_MAJOR_VERSION}.${MEDIASTREAMER_MINOR_VERSION}.${MEDIASTREAMER_MICRO_VERSION}")
set(MEDIASTREAMER_SO_VERSION "3")
set(MEDIASTREAMER_SO_VERSION "5")
string(REGEX MATCH "^arm*" FIXED_POINT_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}")
if(FIXED_POINT_PROCESSOR)
......
......@@ -16,7 +16,7 @@ MEDIASTREAMER_MINOR_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f2)
MEDIASTREAMER_MICRO_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f3)
MEDIASTREAMER_EXTRA_VERSION=$(echo $PACKAGE_VERSION | cut -d. -f4)
LIBMEDIASTREAMER_SO_CURRENT=4 dnl increment this number when you add/change/remove an interface
LIBMEDIASTREAMER_SO_CURRENT=5 dnl increment this number when you add/change/remove an interface
LIBMEDIASTREAMER_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
LIBMEDIASTREAMER_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface
......
......@@ -63,8 +63,9 @@ enum _MSTickerPrio{
typedef enum _MSTickerPrio MSTickerPrio;
struct _MSTickerLateEvent{
int lateMs; /**<number of milliseconds late*/
uint64_t time; /**<time of late event, in milliseconds*/
int lateMs; /**< late at the time of the last event, in milliseconds */
uint64_t time; /**< time of late event, in milliseconds */
int current_late_ms; /**< late at the time of the last tick, in milliseconds */
};
typedef struct _MSTickerLateEvent MSTickerLateEvent;
......
......@@ -69,6 +69,9 @@ static void ms_ticker_init(MSTicker *ticker, const MSTickerParams *params)
ticker->prio=params->prio;
ticker->wait_next_tick=wait_next_tick;
ticker->wait_next_tick_data=ticker;
ticker->late_event.lateMs = 0;
ticker->late_event.time = 0;
ticker->late_event.current_late_ms = 0;
ms_ticker_start(ticker);
}
......@@ -451,6 +454,7 @@ void * ms_ticker_run(void *arg)
s->late_event.lateMs=late;
s->late_event.time=late_tick_time;
}
s->late_event.current_late_ms = late;
}
ms_mutex_unlock(&s->lock);
unset_high_prio(precision);
......
......@@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/msvideo.h"
#include "mediastreamer2/msticker.h"
#include "layouts.h"
#include <X11/Xlib.h>
......@@ -360,6 +361,7 @@ static void x11video_process(MSFilter *f){
bool_t precious=FALSE;
bool_t local_precious=FALSE;
XWindowAttributes wa;
MSTickerLateEvent late_info;
ms_filter_lock(f);
......@@ -377,6 +379,11 @@ static void x11video_process(MSFilter *f){
XClearWindow(obj->display,obj->window_id);
}
ms_ticker_get_last_late_tick(f->ticker, &late_info);
if(late_info.current_late_ms > 100) {
ms_warning("Dropping frames because we're late");
goto end;
}
if (!obj->show) {
goto end;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment