Commit 1c8e73a5 authored by Guillaume Beraudo's avatar Guillaume Beraudo

Merge branch 'master' of git.linphone.org:mediastreamer2

Conflicts:
	tests/mediastream.c
parents cc5c8261 d1ea30fb
......@@ -193,6 +193,25 @@ AC_DEFUN([MS_CHECK_VIDEO],[
[have_theora=no])
fi
AC_ARG_ENABLE(vp8,
[ --disable-vp8 Disable vp8 support],
[case "${enableval}" in
yes) vp8=true ;;
no) vp8=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-vp8) ;;
esac],[vp8=true])
if test x$vp8 = xtrue; then
PKG_CHECK_MODULES(VP8, [vpx >= 0.9.6 ], [have_vp8=yes],
[have_vp8=no])
PKG_CHECK_MODULES(SWSCALE, [libswscale >= 0.7.0 ],[have_vp8=$have_vp8] , have_vp8=no)
fi
if test "$have_vp8" = "true" ; then
VIDEO_CFLAGS=" $VIDEO_CFLAGS $SWSCALE_CFLAGS"
VIDEO_LIBS=" $VIDEO_LIBS $SWSCALE_LIBS"
fi
if test "$ffmpeg" = "false"; then
FFMPEG_CFLAGS=" $FFMPEG_CFLAGS -DNO_FFMPEG"
fi
......
......@@ -546,6 +546,7 @@ AM_CONDITIONAL(BUILD_GSM, test x$build_gsm = xyes )
MS_CHECK_VIDEO
AM_CONDITIONAL(BUILD_VIDEO, test "$video" = "true")
AM_CONDITIONAL(BUILD_THEORA, test "$have_theora" = "yes")
AM_CONDITIONAL(BUILD_VP8, test "$have_vp8" = "yes")
AM_CONDITIONAL(BUILD_WIN32, test "$mingw_found" = "yes")
AM_CONDITIONAL(BUILD_WIN32_WCE, test "$mingw32ce_found" = "yes")
AM_CONDITIONAL(BUILD_FFMPEG, test "$ffmpeg" = "true")
......
......@@ -107,7 +107,9 @@ typedef enum MSFilterId{
MS_ANDROID_DISPLAY_ID,
MS_ANDROID_VIDEO_READ_ID,
MS_ANDROID_VIDEO_WRITE_ID,
MS_TONE_DETECTOR_ID
MS_TONE_DETECTOR_ID,
MS_VP8_ENC_ID,
MS_VP8_DEC_ID
} MSFilterId;
......
......@@ -33,6 +33,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ortp/zrtp.h>
#define PAYLOAD_TYPE_FLAG_CAN_RECV PAYLOAD_TYPE_USER_FLAG_1
#define PAYLOAD_TYPE_FLAG_CAN_SEND PAYLOAD_TYPE_USER_FLAG_2
typedef enum EchoLimiterType{
ELInactive,
ELControlMic,
......
......@@ -133,6 +133,10 @@ if BUILD_THEORA
libmediastreamer_la_SOURCES+=theora.c
endif
if BUILD_VP8
libmediastreamer_la_SOURCES+=vp8.c
endif
if BUILD_FFMPEG
libmediastreamer_la_SOURCES+= videoenc.c \
videodec.c \
......
......@@ -260,7 +260,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec)
{
RtpSession *rtps=stream->session;
PayloadType *pt;
PayloadType *pt,*tel_ev;
int tmp;
MSConnectionHelper h;
int sample_rate;
......@@ -298,7 +298,9 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_error("audiostream.c: undefined payload type.");
return -1;
}
if (rtp_profile_get_payload_from_mime (profile,"telephone-event")==NULL
tel_ev=rtp_profile_get_payload_from_mime (profile,"telephone-event");
if ( (tel_ev==NULL || ( (tel_ev->flags & PAYLOAD_TYPE_FLAG_CAN_RECV) && !(tel_ev->flags & PAYLOAD_TYPE_FLAG_CAN_SEND)))
&& ( strcasecmp(pt->mime_type,"pcmu")==0 || strcasecmp(pt->mime_type,"pcma")==0)){
/*if no telephone-event payload is usable and pcma or pcmu is used, we will generate
inband dtmf*/
......
......@@ -28,9 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "ortp/b64.h"
static uint64_t fpu_last_requested_time=0;
typedef struct _DecData{
mblk_t *yuv_msg;
mblk_t *sps,*pps;
......@@ -41,6 +38,7 @@ typedef struct _DecData{
unsigned int packet_num;
uint8_t *bitstream;
int bitstream_size;
uint64_t last_error_reported_time;
}DecData;
static void ffmpeg_init(){
......@@ -78,6 +76,7 @@ static void dec_init(MSFilter *f){
d->outbuf.h=0;
d->bitstream_size=65536;
d->bitstream=ms_malloc0(d->bitstream_size);
d->last_error_reported_time=0;
f->data=d;
}
......@@ -259,8 +258,8 @@ static void dec_process(MSFilter *f){
len=avcodec_decode_video2(&d->av_context,&orig,&got_picture,&pkt);
if (len<=0) {
ms_warning("ms_AVdecoder_process: error %i.",len);
if ((f->ticker->time - fpu_last_requested_time)>5000 || fpu_last_requested_time==0) {
fpu_last_requested_time=f->ticker->time;
if ((f->ticker->time - d->last_error_reported_time)>5000 || d->last_error_reported_time==0) {
d->last_error_reported_time=f->ticker->time;
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_DECODING_ERRORS);
}
break;
......
......@@ -31,8 +31,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern void ms_ffmpeg_check_init();
static uint64_t fpu_last_requested_time=0;
typedef struct DecState{
AVCodecContext av_context;
......@@ -45,6 +43,7 @@ typedef struct DecState{
enum PixelFormat output_pix_fmt;
uint8_t dci[512];
int dci_size;
uint64_t last_error_reported_time;
bool_t snow_initialized;
}DecState;
......@@ -639,6 +638,7 @@ static void dec_process_frame(MSFilter *f, mblk_t *inm){
else if (f->desc->id==MS_H263_OLD_DEC_ID) inm=skip_rfc2190_header(inm);
else if (s->codec==CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm);
else if (s->codec==CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm);
if (inm){
/* accumulate the video packet until we have the rtp markbit*/
if (s->input==NULL){
......@@ -673,8 +673,8 @@ static void dec_process_frame(MSFilter *f, mblk_t *inm){
len=avcodec_decode_video2(&s->av_context,&orig,&got_picture,&pkt);
if (len<=0) {
ms_warning("ms_AVdecoder_process: error %i.",len);
if ((f->ticker->time - fpu_last_requested_time)>5000 || fpu_last_requested_time==0) {
fpu_last_requested_time=f->ticker->time;
if ((f->ticker->time - s->last_error_reported_time)>5000 || s->last_error_reported_time==0) {
s->last_error_reported_time=f->ticker->time;
ms_filter_notify_no_arg(f,MS_VIDEO_DECODER_DECODING_ERRORS);
}
break;
......
......@@ -792,7 +792,9 @@ static void process_frame(MSFilter *f, mblk_t *inm){
comp_buf->b_wptr+=4;
comp_buf_sz-=4;
}
error=avcodec_encode_video(c, (uint8_t*)comp_buf->b_wptr,comp_buf_sz, &pict);
if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error);
else{
s->framenum++;
......
This diff is collapsed.
......@@ -30,6 +30,7 @@ LDADD= $(top_builddir)/src/libmediastreamer.la \
$(SPEEX_LIBS) \
$(GSM_LIBS) \
$(THEORA_LIBS) \
$(VP8_LIBS) \
$(VIDEO_LIBS)
......
......@@ -183,6 +183,8 @@ const char *usage="mediastream --local <port> --remote <ip:port> --payload <payl
;
int main(int argc, char * argv[])
{
int i;
......@@ -322,6 +324,7 @@ int main(int argc, char * argv[])
rtp_profile_set_payload(&av_profile,99,&payload_type_mp4v);
rtp_profile_set_payload(&av_profile,100,&payload_type_x_snow);
rtp_profile_set_payload(&av_profile,102,&payload_type_h264);
rtp_profile_set_payload(&av_profile,103,&payload_type_vp8);
#endif
......
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