Commit 3a480a10 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Merge branch 'master' into dev_audio_bypass

parents 75fe8bcf da046f0c
......@@ -46,6 +46,7 @@ set(HEADER_FILES
msfilerec.h
msfilter.h
msgenericplc.h
msiframerequestslimiter.h
msinterfaces.h
msitc.h
msjava.h
......
......@@ -26,6 +26,7 @@ mediastreamer2_include_HEADERS=allfilters.h \
msfilerec.h \
msfilter.h \
msgenericplc.h \
msiframerequestslimiter.h \
msinterfaces.h \
msitc.h \
msjava.h \
......@@ -33,6 +34,7 @@ mediastreamer2_include_HEADERS=allfilters.h \
msmediaplayer.h \
msqueue.h \
msrtp.h \
msrtt4103.h \
mssndcard.h \
mstee.h \
msticker.h \
......@@ -52,8 +54,7 @@ mediastreamer2_include_HEADERS=allfilters.h \
upnp_igd.h \
videostarter.h \
x11_helper.h \
zrtp.h \
msrtt4103.h
zrtp.h
EXTRA_DIST=$(mediastreamer2_include_HEADERS)
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org)
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef MS_IFRAME_REQUESTS_LIMITER_H
#define MS_IFRAME_REQUESTS_LIMITER_H
#include <mediastreamer2/msticker.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _MSIFrameRequestsLimiterCtx {
const MSTicker *ticker;
bool_t iframe_required;
uint64_t last_sent_iframe_time;
int min_iframe_interval;
} MSIFrameRequestsLimiterCtx;
MS2_PUBLIC void ms_iframe_requests_limiter_init(MSIFrameRequestsLimiterCtx *obj, const MSTicker *t, int min_iframe_interval);
MS2_PUBLIC void ms_iframe_requests_limiter_require_iframe(MSIFrameRequestsLimiterCtx *obj);
MS2_PUBLIC bool_t ms_iframe_requests_limiter_iframe_sending_authorized(const MSIFrameRequestsLimiterCtx *obj);
MS2_PUBLIC void ms_iframe_requests_limiter_notify_iframe_sent(MSIFrameRequestsLimiterCtx *obj);
#ifdef __cplusplus
}
#endif
#endif
......@@ -38,7 +38,11 @@ public final class Log {
TAG = tag;
isLogEnabled = enable;
}
public static void setEnableLog(boolean enable){
isLogEnabled = enable;
}
@SuppressWarnings(value="all")
private static boolean isLoggable(int level) {
return isLogEnabled && (!useIsLoggable || android.util.Log.isLoggable(TAG, level));
......
......@@ -168,6 +168,7 @@ set(VOIP_SOURCE_FILES_C
voip/bitratedriver.c
voip/ice.c
voip/mediastream.c
voip/msiframerequestslimiter.c
voip/msmediaplayer.c
voip/msvoip.c
voip/private.h
......@@ -377,12 +378,6 @@ if(ENABLE_VIDEO)
voip/vp8rtpfmt.h
)
endif()
if(MATROSKA2_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
videofilters/mkv.c
utils/mkv_reader.c
)
endif()
if(X11_FOUND)
list(APPEND VOIP_SOURCE_FILES_C utils/x11_helper.c)
endif()
......@@ -390,6 +385,14 @@ if(ENABLE_VIDEO)
list(APPEND VOIP_SOURCE_FILES_C videofilters/x11video.c)
endif()
endif()
if(MATROSKA2_FOUND)
list(APPEND VOIP_SOURCE_FILES_C
videofilters/mkv.c
utils/mkv_reader.c
voip/rfc2429.h
voip/rfc3984.c
)
endif()
set(VOIP_SOURCE_FILES_ALL ${VOIP_SOURCE_FILES_C} ${VOIP_SOURCE_FILES_CXX} ${VOIP_SOURCE_FILES_OBJC})
......
......@@ -112,7 +112,8 @@ libmediastreamer_voip_la_SOURCES+= voip/private.h \
voip/stun.c \
voip/stun_udp.c \
crypto/ms_srtp.c \
crypto/dtls_srtp.c
crypto/dtls_srtp.c \
voip/msiframerequestslimiter.c
else
libmediastreamer_base_la_SOURCES+= ortp-deps/logging.c \
ortp-deps/port.c \
......
......@@ -57,6 +57,7 @@ static SoundDeviceDescription devices[]={
{ "HTC", "HTC One_M8", "msm8974", 0, 120 },
{ "LGE", "LS670", "", 0, 170 },
{ "LGE", "Nexus 5", "msm8974", 0, 0 , 16000 },
{ "LGE", "LG-H815", "msm8992", DEVICE_HAS_BUILTIN_AEC, 0 },
{ "motorola", "DROID RAZR", "", 0, 400 },
{ "motorola", "MB860", "", 0, 200 },
......
......@@ -378,22 +378,18 @@ static void player_process(MSFilter *f){
ms_queue_put(f->outputs[0],om);
}else freemsg(om);
if (err<bytes){
ms_filter_notify_no_arg(f,MS_PLAYER_EOF);
/*for compatibility:*/
ms_filter_notify_no_arg(f,MS_FILE_PLAYER_EOF);
lseek(d->fd,d->hsize,SEEK_SET);
/* special value for playing file only once */
if (d->loop_after<0)
{
if (d->loop_after<0){
d->state=MSPlayerPaused;
ms_filter_unlock(f);
return;
}
if (d->loop_after>=0){
}else if (d->loop_after>=0){
d->pause_time=d->loop_after;
}
ms_filter_notify_no_arg(f,MS_PLAYER_EOF);
/*for compatibility:*/
ms_filter_notify_no_arg(f,MS_FILE_PLAYER_EOF);
}
}else{
ms_warning("Fail to read %i bytes: %s",bytes,strerror(errno));
......
This diff is collapsed.
#include "mediastreamer2/msiframerequestslimiter.h"
void ms_iframe_requests_limiter_init(MSIFrameRequestsLimiterCtx *obj, const MSTicker *t, int min_iframe_interval) {
memset(obj, 0, sizeof(MSIFrameRequestsLimiterCtx));
obj->ticker = t;
obj->last_sent_iframe_time = t->time;
obj->min_iframe_interval = min_iframe_interval;
}
void ms_iframe_requests_limiter_require_iframe(MSIFrameRequestsLimiterCtx *obj) {
obj->iframe_required = TRUE;
}
bool_t ms_iframe_requests_limiter_iframe_sending_authorized(const MSIFrameRequestsLimiterCtx *obj) {
return obj->iframe_required && (obj->ticker->time - obj->last_sent_iframe_time) > obj->min_iframe_interval;
}
void ms_iframe_requests_limiter_notify_iframe_sent(MSIFrameRequestsLimiterCtx *obj) {
obj->iframe_required = FALSE;
obj->last_sent_iframe_time = obj->ticker->time;
}
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