summaryrefslogtreecommitdiffstats
path: root/tinyDAV/include/tinydav
diff options
context:
space:
mode:
authorMamadou DIOP <bossiel@yahoo.fr>2016-02-23 22:00:35 +0100
committerMamadou DIOP <bossiel@yahoo.fr>2016-02-23 22:00:35 +0100
commit50dfb4359619563012997bc3ddafb7667741066c (patch)
treedb234c1edc3240a653363b5735fc4077af4b8720 /tinyDAV/include/tinydav
parent94b2219209038e05dd26395f6fb700be4d1062c0 (diff)
downloaddoubango-50dfb4359619563012997bc3ddafb7667741066c.zip
doubango-50dfb4359619563012997bc3ddafb7667741066c.tar.gz
Add new QoS implementation
Code formatting
Diffstat (limited to 'tinyDAV/include/tinydav')
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h43
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h19
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h45
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h19
-rwxr-xr-xtinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h37
-rwxr-xr-xtinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_consumer_audio.h23
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_jitterbuffer.h144
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_producer_audio.h11
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_session_audio.h93
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h27
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_denoise.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_speex_resampler.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h6
-rwxr-xr-xtinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h27
-rwxr-xr-xtinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h33
-rwxr-xr-xtinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h53
-rwxr-xr-xtinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h31
-rwxr-xr-xtinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g711/g711.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h16
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h19
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h53
-rwxr-xr-xtinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h15
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h61
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h8
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h546
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h77
-rwxr-xr-xtinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h74
-rwxr-xr-xtinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h19
-rwxr-xr-xtinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h4
-rwxr-xr-xtinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h52
-rwxr-xr-xtinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h11
-rwxr-xr-xtinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h6
-rwxr-xr-xtinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h6
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h11
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_producer_msrp.h6
-rwxr-xr-xtinyDAV/include/tinydav/msrp/tdav_session_msrp.h111
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_consumer_t140.h25
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_producer_t140.h15
-rwxr-xr-xtinyDAV/include/tinydav/t140/tdav_session_t140.h111
-rwxr-xr-xtinyDAV/include/tinydav/tdav.h85
-rwxr-xr-xtinyDAV/include/tinydav/tdav_apple.h6
-rwxr-xr-xtinyDAV/include/tinydav/tdav_session_av.h168
-rwxr-xr-xtinyDAV/include/tinydav/tdav_win32.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/jb/tdav_video_frame.h25
-rwxr-xr-xtinyDAV/include/tinydav/video/jb/tdav_video_jb.h63
-rwxr-xr-xtinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_consumer_video.h19
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_converter_video.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_runnable_video.h13
-rwxr-xr-xtinyDAV/include/tinydav/video/tdav_session_video.h161
-rwxr-xr-xtinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h6
-rwxr-xr-xtinyDAV/include/tinydav/video/winm/tdav_producer_winm.h6
76 files changed, 1288 insertions, 1316 deletions
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
index d6b0673..5df148b 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_common_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
@@ -33,27 +33,26 @@ TDAV_BEGIN_DECLS
#include <alsa/asoundlib.h>
-typedef struct tdav_common_alsa_s
-{
- tsk_bool_t b_initialized;
- tsk_bool_t b_muted;
- tsk_bool_t b_started;
- tsk_bool_t b_prepared;
- tsk_bool_t b_paused;
- tsk_bool_t b_capture;
-
- tsk_size_t n_buff_size_in_bytes;
- tsk_size_t n_buff_size_in_samples;
- uint8_t* p_buff_ptr;
+typedef struct tdav_common_alsa_s {
+ tsk_bool_t b_initialized;
+ tsk_bool_t b_muted;
+ tsk_bool_t b_started;
+ tsk_bool_t b_prepared;
+ tsk_bool_t b_paused;
+ tsk_bool_t b_capture;
+
+ tsk_size_t n_buff_size_in_bytes;
+ tsk_size_t n_buff_size_in_samples;
+ uint8_t* p_buff_ptr;
+
+ int channels;
+ int sample_rate;
- int channels;
- int sample_rate;
-
- snd_pcm_t *p_handle;
- snd_pcm_hw_params_t *p_params;
- char* p_device_name;
+ snd_pcm_t *p_handle;
+ snd_pcm_hw_params_t *p_params;
+ char* p_device_name;
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_common_alsa_t;
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
index ae9f0f9..362cd03 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_consumer_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h b/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
index 78fd4eb..74561c4 100755
--- a/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
+++ b/tinyDAV/include/tinydav/audio/alsa/tdav_producer_alsa.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
index 128681a..3db4e6a 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
index c7b1954..f278b4c 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audioqueue.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2015 Mamadou DIOP.
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -40,16 +40,15 @@ TDAV_BEGIN_DECLS
# define CoreAudioPlayBuffers 3
#endif
-typedef struct tdav_consumer_audioqueue_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
-
- tsk_bool_t started;
-
+typedef struct tdav_consumer_audioqueue_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+
+ tsk_bool_t started;
+
AudioStreamBasicDescription description;
AudioQueueRef queue;
AudioQueueBufferRef buffers[CoreAudioPlayBuffers];
-
+
tsk_size_t buffer_size;
}
tdav_consumer_audioqueue_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
index 509f787..ca48978 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_consumer_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -36,26 +36,25 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_consumer_audiounit_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
-
- tdav_audiounit_handle_t* audioUnitHandle;
- unsigned started:1;
- unsigned paused:1;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- tsk_ssize_t leftBytes;
- SpeexBuffer* buffer;
- tsk_size_t size;
- tsk_mutex_handle_t* mutex;
- } ring;
-
- tmedia_resampler_t *resampler;
+typedef struct tdav_consumer_audiounit_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
+
+ tdav_audiounit_handle_t* audioUnitHandle;
+ unsigned started:1;
+ unsigned paused:1;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ tsk_ssize_t leftBytes;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ tsk_mutex_handle_t* mutex;
+ } ring;
+
+ tmedia_resampler_t *resampler;
}
tdav_consumer_audiounit_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
index 27c9b98..4a858a9 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audioqueue.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -40,16 +40,15 @@ TDAV_BEGIN_DECLS
#define CoreAudioRecordBuffers 3
-typedef struct tdav_producer_audioqueue_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t started;
-
+typedef struct tdav_producer_audioqueue_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t started;
+
AudioStreamBasicDescription description;
AudioQueueRef queue;
AudioQueueBufferRef buffers[CoreAudioRecordBuffers];
-
+
tsk_size_t buffer_size;
}
tdav_producer_audioqueue_t;
diff --git a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
index c1a99cb..bcc44d7 100755
--- a/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
+++ b/tinyDAV/include/tinydav/audio/coreaudio/tdav_producer_audiounit.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
@@ -35,23 +35,22 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_producer_audiounit_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tdav_audiounit_handle_t* audioUnitHandle;
- unsigned started:1;
- unsigned paused:1;
+typedef struct tdav_producer_audiounit_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tdav_audiounit_handle_t* audioUnitHandle;
+ unsigned started:1;
+ unsigned paused:1;
unsigned muted;
-
- struct {
- struct {
- void* buffer;
- tsk_size_t size;
- } chunck;
- SpeexBuffer* buffer;
- tsk_size_t size;
- } ring;
+
+ struct {
+ struct {
+ void* buffer;
+ tsk_size_t size;
+ } chunck;
+ SpeexBuffer* buffer;
+ tsk_size_t size;
+ } ring;
}
tdav_producer_audiounit_t;
diff --git a/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h b/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
index dbba1a8..1cc5331 100755
--- a/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
+++ b/tinyDAV/include/tinydav/audio/directsound/tdav_consumer_dsound.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h b/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
index 1f68008..7252fa9 100755
--- a/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
+++ b/tinyDAV/include/tinydav/audio/directsound/tdav_producer_dsound.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h b/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
index 64deeef..278457b 100755
--- a/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
+++ b/tinyDAV/include/tinydav/audio/oss/tdav_consumer_oss.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h b/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
index 2fa00ff..c32462b 100755
--- a/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
+++ b/tinyDAV/include/tinydav/audio/oss/tdav_producer_oss.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h b/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
index c561d84..4f8cc48 100755
--- a/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_consumer_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,15 +38,14 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_AUDIO(self) ((tdav_consumer_audio_t*)(self))
-typedef struct tdav_consumer_audio_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- struct tmedia_denoise_s* denoise;
- struct tmedia_resampler_s* resampler;
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_consumer_audio_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ struct tmedia_denoise_s* denoise;
+ struct tmedia_resampler_s* resampler;
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
index c6d2449..f248da1 100755
--- a/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_jitterbuffer.h
@@ -1,21 +1,21 @@
/* File from: http://cms.speakup.nl/tech/opensource/jitterbuffer/verslag-20051209.pdf/ */
/*******************************************************
- * jitterbuffer:
- * an application-independent jitterbuffer, which tries
+ * jitterbuffer:
+ * an application-independent jitterbuffer, which tries
* to achieve the maximum user perception during a call.
* For more information look at:
* http://www.speakup.nl/opensource/jitterbuffer/
*
* Copyright on this file is held by:
- * - Jesse Kaijen <jesse@speakup.nl>
+ * - Jesse Kaijen <jesse@speakup.nl>
* - SpeakUp <info@speakup.nl>
*
* Contributors:
* Jesse Kaijen <jesse@speakup.nl>
*
* Version: 1.1
- *
+ *
* Changelog:
* 1.0 => 1.1 (2006-03-24) (thanks to Micheal Jerris, freeswitch.org)
* - added MSVC 2005 project files
@@ -25,13 +25,13 @@
* This program is free software, distributed under the terms of:
* - the GNU Lesser (Library) General Public License
* - the Mozilla Public License
- *
+ *
* if you are interested in an different licence type, please contact us.
*
- * How to use the jitterbuffer, please look at the comments
+ * How to use the jitterbuffer, please look at the comments
* in the headerfile.
*
- * Further details on specific implementations,
+ * Further details on specific implementations,
* please look at the comments in the code file.
*/
@@ -48,26 +48,26 @@ TDAV_BEGIN_DECLS
* The header file consists of four parts.
* - configuration constants, structs and parameter definitions
* - functions
- * - How to use the jitterbuffer and
+ * - How to use the jitterbuffer and
* which responsibilities do YOU have
* - debug messages explained
*/
// configuration constants
-/* Number of historical timestamps to use in calculating jitter and jitterbuffer size */
+/* Number of historical timestamps to use in calculating jitter and jitterbuffer size */
#ifndef JB_HISTORY_SIZE
# define JB_HISTORY_SIZE 500
#endif
/* minimum jitterbuffer size, disabled if 0 */
#define JB_MIN_SIZE 0
-/* maximum jitterbuffer size, disabled if 0 */
+/* maximum jitterbuffer size, disabled if 0 */
#define JB_MAX_SIZE 0
- /* maximum successive interpolating frames, disabled if 0 */
+/* maximum successive interpolating frames, disabled if 0 */
#define JB_MAX_SUCCESSIVE_INTERP 0
/* amount of extra delay allowed before shrinking */
-#define JB_ALLOW_EXTRA_DELAY 30
+#define JB_ALLOW_EXTRA_DELAY 30
/* ms between growing */
#define JB_WAIT_GROW 60
/* ms between shrinking */
@@ -77,70 +77,70 @@ TDAV_BEGIN_DECLS
//structs
typedef struct jb_info {
- long frames_received; /* Number of frames received by the jitterbuffer */
- long frames_late; /* Number of frames that were late */
- long frames_lost; /* Number of frames that were lost */
- long frames_ooo; /* Number of frames that were Out Of Order */
- long frames_dropped; /* Number of frames that were dropped due shrinkage of the jitterbuffer */
- long frames_dropped_twice; /* Number of frames that were dropped because this timestamp was already in the jitterbuffer */
-
- long delay; /* Current delay due the jitterbuffer */
- long jitter; /* jitter measured within current history interval*/
- long losspct; /* recent lost frame percentage (network and jitterbuffer loss) */
-
- long delay_target; /* The delay where we want to grow to */
- long losspct_jb; /* recent lost percentage due the jitterbuffer */
- long last_voice_ms; /* the duration of the last voice frame */
- short silence; /* If we are in silence 1-yes 0-no */
- long iqr; /* Inter Quartile Range of current history, if the squareroot is taken it is a good estimate of jitter */
+ long frames_received; /* Number of frames received by the jitterbuffer */
+ long frames_late; /* Number of frames that were late */
+ long frames_lost; /* Number of frames that were lost */
+ long frames_ooo; /* Number of frames that were Out Of Order */
+ long frames_dropped; /* Number of frames that were dropped due shrinkage of the jitterbuffer */
+ long frames_dropped_twice; /* Number of frames that were dropped because this timestamp was already in the jitterbuffer */
+
+ long delay; /* Current delay due the jitterbuffer */
+ long jitter; /* jitter measured within current history interval*/
+ long losspct; /* recent lost frame percentage (network and jitterbuffer loss) */
+
+ long delay_target; /* The delay where we want to grow to */
+ long losspct_jb; /* recent lost percentage due the jitterbuffer */
+ long last_voice_ms; /* the duration of the last voice frame */
+ short silence; /* If we are in silence 1-yes 0-no */
+ long iqr; /* Inter Quartile Range of current history, if the squareroot is taken it is a good estimate of jitter */
} jb_info;
typedef struct jb_frame {
- void *data; /* the frame data */
- long ts; /* the senders timestamp */
- long ms; /* length of this frame in ms */
- int type; /* the type of frame */
- int codec; /* codec of this frame, undefined if nonvoice */
- struct jb_frame *next, *prev; /* pointers to the next and previous frames in the queue */
+ void *data; /* the frame data */
+ long ts; /* the senders timestamp */
+ long ms; /* length of this frame in ms */
+ int type; /* the type of frame */
+ int codec; /* codec of this frame, undefined if nonvoice */
+ struct jb_frame *next, *prev; /* pointers to the next and previous frames in the queue */
} jb_frame;
typedef struct jb_hist_element {
- long delay; /* difference between time of arrival and senders timestamp */
- long ts; /* senders timestamp */
- long ms; /* length of this frame in ms */
- int codec; /* wich codec this frame has */
-} jb_hist_element;
+ long delay; /* difference between time of arrival and senders timestamp */
+ long ts; /* senders timestamp */
+ long ms; /* length of this frame in ms */
+ int codec; /* wich codec this frame has */
+} jb_hist_element;
typedef struct jb_settings {
- /* settings */
- long min_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
- long max_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
- long max_successive_interp; /* the maximum count of successive interpolations before assuming silence */
- long extra_delay; /* amount of extra delay allowed before shrinking */
- long wait_grow; /* ms between growing */
- long wait_shrink; /* ms between shrinking */
- long max_diff; /* maximum number of milliseconds the jitterbuffer may be off */
+ /* settings */
+ long min_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
+ long max_jb; /* defines a hard clamp to use in setting the jitterbuffer delay */
+ long max_successive_interp; /* the maximum count of successive interpolations before assuming silence */
+ long extra_delay; /* amount of extra delay allowed before shrinking */
+ long wait_grow; /* ms between growing */
+ long wait_shrink; /* ms between shrinking */
+ long max_diff; /* maximum number of milliseconds the jitterbuffer may be off */
} jb_settings;
typedef struct jitterbuffer {
- struct jb_hist_element hist[JB_HISTORY_SIZE]; /* the history of the last received frames */
- long hist_sorted_delay[JB_HISTORY_SIZE]; /* a sorted buffer of the delays (lowest first) */
- long hist_sorted_timestamp[JB_HISTORY_SIZE]; /* a sorted buffer of the timestamps (lowest first) */
-
- int hist_pointer; /* points to index in history for next entry */
- long last_adjustment; /* the time of the last adjustment (growing or shrinking) */
- long next_voice_time; /* the next ts is to be read from the jb (senders timestamp) */
- long cnt_successive_interp; /* the count of consecutive interpolation frames */
- long silence_begin_ts; /* the time of the last CNG frame, when in silence */
- long min; /* the clock difference within current history interval */
- long current; /* the present jitterbuffer adjustment */
- long target; /* the target jitterbuffer adjustment */
- long last_delay; /* the delay of the last packet, used for calc. jitter */
-
- jb_frame *voiceframes; /* queued voiceframes */
- jb_frame *controlframes; /* queued controlframes */
- jb_settings settings; /* the settings of the jitterbuffer */
- jb_info info; /* the statistics of the jitterbuffer */
+ struct jb_hist_element hist[JB_HISTORY_SIZE]; /* the history of the last received frames */
+ long hist_sorted_delay[JB_HISTORY_SIZE]; /* a sorted buffer of the delays (lowest first) */
+ long hist_sorted_timestamp[JB_HISTORY_SIZE]; /* a sorted buffer of the timestamps (lowest first) */
+
+ int hist_pointer; /* points to index in history for next entry */
+ long last_adjustment; /* the time of the last adjustment (growing or shrinking) */
+ long next_voice_time; /* the next ts is to be read from the jb (senders timestamp) */
+ long cnt_successive_interp; /* the count of consecutive interpolation frames */
+ long silence_begin_ts; /* the time of the last CNG frame, when in silence */
+ long min; /* the clock difference within current history interval */
+ long current; /* the present jitterbuffer adjustment */
+ long target; /* the target jitterbuffer adjustment */
+ long last_delay; /* the delay of the last packet, used for calc. jitter */
+
+ jb_frame *voiceframes; /* queued voiceframes */
+ jb_frame *controlframes; /* queued controlframes */
+ jb_settings settings; /* the settings of the jitterbuffer */
+ jb_info info; /* the statistics of the jitterbuffer */
} jitterbuffer;
//parameter definitions
@@ -174,24 +174,24 @@ typedef struct jitterbuffer {
/*
* Creates a new jitterbuffer and sets the default settings.
- * Always use this function for creating a new jitterbuffer.
+ * Always use this function for creating a new jitterbuffer.
*/
jitterbuffer *jb_new();
/*
- * The control frames and possible personal settings are kept.
- * History and voice/silence frames are destroyed.
+ * The control frames and possible personal settings are kept.
+ * History and voice/silence frames are destroyed.
*/
void jb_reset(jitterbuffer *jb);
/*
* Resets the jitterbuffer totally, all the control/voice/silence frames are destroyed
- * default settings are put as well.
+ * default settings are put as well.
*/
void jb_reset_all(jitterbuffer *jb);
/*
- * Destroy the jitterbuffer and any frame within.
+ * Destroy the jitterbuffer and any frame within.
* Always use this function for destroying a jitterbuffer,
* otherwise there is a chance of memory leaking.
*/
@@ -204,7 +204,7 @@ void jb_destroy(jitterbuffer *jb);
void jb_set_settings(jitterbuffer *jb, jb_settings *settings);
/*
- * Get the statistics for the jitterbuffer.
+ * Get the statistics for the jitterbuffer.
* Copying the statistics directly for the jitterbuffer won't work because
* The statistics are only calculated when calling this function.
*/
@@ -248,7 +248,7 @@ void jb_put(jitterbuffer *jb, void *data, int type, long ms, long ts, long now,
* Get a packet from the jitterbuffer if it's available.
* control packets have a higher priority above voice and silence packets
* they are always delivered as fast as possible. The delay of the jitterbuffer
- * doesn't work for these packets.
+ * doesn't work for these packets.
* @REQUIRE 1<interpl <= jb->settings->extra_delay (=default JB_ALLOW_EXTRA_DELAY)
*
* return will be:
diff --git a/tinyDAV/include/tinydav/audio/tdav_producer_audio.h b/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
index 47e0a4f..2cd3808 100755
--- a/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_producer_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,9 +40,8 @@ TDAV_BEGIN_DECLS
#define TDAV_PRODUCER_AUDIO(self) ((tdav_producer_audio_t*)(self))
-typedef struct tdav_producer_audio_s
-{
- TMEDIA_DECLARE_PRODUCER;
+typedef struct tdav_producer_audio_s {
+ TMEDIA_DECLARE_PRODUCER;
}
tdav_producer_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_session_audio.h b/tinyDAV/include/tinydav/audio/tdav_session_audio.h
index e2ab66f..4f1403b 100755
--- a/tinyDAV/include/tinydav/audio/tdav_session_audio.h
+++ b/tinyDAV/include/tinydav/audio/tdav_session_audio.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,50 +39,49 @@ TDAV_BEGIN_DECLS
typedef tsk_list_t tdav_session_audio_dtmfe_L_t;
-typedef struct tdav_session_audio_s
-{
- TDAV_DECLARE_SESSION_AV;
-
- tsk_bool_t is_started;
-
- struct {
- unsigned started:1;
- tsk_timer_manager_handle_t* handle_mgr_global;
- } timer;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- struct {
- void* buffer;
- tsk_size_t buffer_size;
- struct tmedia_resampler_s* instance;
- } resampler;
- } encoder;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- struct {
- void* buffer;
- tsk_size_t buffer_size;
- struct tmedia_resampler_s* instance;
- } resampler;
- } decoder;
-
- struct tmedia_denoise_s* denoise;
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- tdav_session_audio_dtmfe_L_t* dtmf_events;
- tsk_bool_t is_sending_dtmf_events;
+typedef struct tdav_session_audio_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ tsk_bool_t is_started;
+
+ struct {
+ unsigned started:1;
+ tsk_timer_manager_handle_t* handle_mgr_global;
+ } timer;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+ struct tmedia_resampler_s* instance;
+ } resampler;
+ } encoder;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+ struct tmedia_resampler_s* instance;
+ } resampler;
+ } decoder;
+
+ struct tmedia_denoise_s* denoise;
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ tdav_session_audio_dtmfe_L_t* dtmf_events;
+ tsk_bool_t is_sending_dtmf_events;
}
tdav_session_audio_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
index e80c7b5..4eaa53d 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speakup_jitterbuffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,17 +39,16 @@
TDAV_BEGIN_DECLS
/** Speakuo JitterBufferr*/
-typedef struct tdav_speakup_jitterBuffer_s
-{
- TMEDIA_DECLARE_JITTER_BUFFER;
-
- jitterbuffer *jbuffer;
- uint8_t jcodec;
- uint64_t ref_timestamp;
- uint32_t frame_duration;
- uint32_t rate;
- uint32_t channels;
- uint32_t _10ms_size_bytes;
+typedef struct tdav_speakup_jitterBuffer_s {
+ TMEDIA_DECLARE_JITTER_BUFFER;
+
+ jitterbuffer *jbuffer;
+ uint8_t jcodec;
+ uint64_t ref_timestamp;
+ uint32_t frame_duration;
+ uint32_t rate;
+ uint32_t channels;
+ uint32_t _10ms_size_bytes;
}
tdav_speakup_jitterbuffer_t;
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h b/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
index 3271066..fe6d90f 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_denoise.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h b/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
index 019db5d..f54525a 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_jitterbuffer.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h b/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
index 635882d..84d2296 100755
--- a/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
+++ b/tinyDAV/include/tinydav/audio/tdav_speex_resampler.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h b/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
index 7c5e956..69ab671 100755
--- a/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
+++ b/tinyDAV/include/tinydav/audio/tdav_webrtc_denoise.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h b/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
index 0da22e8..ab581e5 100755
--- a/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
+++ b/tinyDAV/include/tinydav/audio/wasapi/tdav_consumer_wasapi.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h b/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
index e215769..9e58ef1 100755
--- a/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
+++ b/tinyDAV/include/tinydav/audio/wasapi/tdav_producer_wasapi.h
@@ -1,18 +1,18 @@
/*Copyright (C) 2013 Mamadou Diop
* Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h b/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
index 7e136cd..bb4f01d 100755
--- a/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
+++ b/tinyDAV/include/tinydav/audio/waveapi/tdav_consumer_waveapi.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,20 +42,19 @@ TDAV_BEGIN_DECLS
#define TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT 4
-typedef struct tdav_consumer_waveapi_s
-{
- TDAV_DECLARE_CONSUMER_AUDIO;
+typedef struct tdav_consumer_waveapi_s {
+ TDAV_DECLARE_CONSUMER_AUDIO;
- tsk_bool_t started;
+ tsk_bool_t started;
- WAVEFORMATEX wfx;
- HWAVEOUT hWaveOut;
- LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT];
- tsk_size_t bytes_per_notif;
+ WAVEFORMATEX wfx;
+ HWAVEOUT hWaveOut;
+ LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_CONSUMER_NOTIF_POS_COUNT];
+ tsk_size_t bytes_per_notif;
- void* tid[1];
- HANDLE events[2];
- CRITICAL_SECTION cs;
+ void* tid[1];
+ HANDLE events[2];
+ CRITICAL_SECTION cs;
}
tdav_consumer_waveapi_t;
diff --git a/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h b/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
index 67614cf..593c7e8 100755
--- a/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
+++ b/tinyDAV/include/tinydav/audio/waveapi/tdav_producer_waveapi.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,20 +42,19 @@ TDAV_BEGIN_DECLS
#define TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT 4
-typedef struct tdav_producer_waveapi_s
-{
- TDAV_DECLARE_PRODUCER_AUDIO;
-
- tsk_bool_t started;
-
- WAVEFORMATEX wfx;
- HWAVEIN hWaveIn;
- LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT];
- tsk_size_t bytes_per_notif;
-
- void* tid[1];
- HANDLE events[2];
- CRITICAL_SECTION cs;
+typedef struct tdav_producer_waveapi_s {
+ TDAV_DECLARE_PRODUCER_AUDIO;
+
+ tsk_bool_t started;
+
+ WAVEFORMATEX wfx;
+ HWAVEIN hWaveIn;
+ LPWAVEHDR hWaveHeaders[TDAV_WAVEAPI_PRODUCER_NOTIF_POS_COUNT];
+ tsk_size_t bytes_per_notif;
+
+ void* tid[1];
+ HANDLE events[2];
+ CRITICAL_SECTION cs;
}
tdav_producer_waveapi_t;
diff --git a/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h b/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
index 5fbc057..e8c1e9e 100755
--- a/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
+++ b/tinyDAV/include/tinydav/bfcp/tdav_session_bfcp.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h b/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
index cb0e33e..d739ad0 100755
--- a/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
+++ b/tinyDAV/include/tinydav/codecs/amr/tdav_codec_amr.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,38 +44,35 @@ TDAV_BEGIN_DECLS
#define TDAV_CODEC_AMR(self) ((tdav_codec_amr_t*)(self))
-typedef enum tdav_codec_amr_type_e
-{
- tdav_codec_amr_type_nb,
- tdav_codec_amr_type_wb,
+typedef enum tdav_codec_amr_type_e {
+ tdav_codec_amr_type_nb,
+ tdav_codec_amr_type_wb,
}
tdav_codec_amr_type_t;
-typedef enum tdav_codec_amr_mode_e
-{
- tdav_codec_amr_mode_oa,
- tdav_codec_amr_mode_be,
+typedef enum tdav_codec_amr_mode_e {
+ tdav_codec_amr_mode_oa,
+ tdav_codec_amr_mode_be,
}
tdav_codec_amr_mode_t;
/** Base class for all AMR codecs */
-typedef struct tdav_codec_amr_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- tdav_codec_amr_type_t type;
- tdav_codec_amr_mode_t mode;
-
- enum Mode encoder_mode;
- void* encoder;
- void* decoder;
-
- unsigned modes:16; /**< 0..7 for NB and 0..8 for WB plus SID, SPEECH_LOST, NO_DATA etc etc */
- unsigned mcp:2; /**< mode-change-periode (1 or 2) */
- unsigned mcc:2; /**< mode-change-capability (1 or 2) */
- unsigned mcn:1; /**< mode-change-neighnor (0 or 1) */
- unsigned crc:1; /**< 0 or 1 */
- unsigned robust_sorting:1; /**< robust-sorting (0 or 1) */
+typedef struct tdav_codec_amr_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ tdav_codec_amr_type_t type;
+ tdav_codec_amr_mode_t mode;
+
+ enum Mode encoder_mode;
+ void* encoder;
+ void* decoder;
+
+ unsigned modes:16; /**< 0..7 for NB and 0..8 for WB plus SID, SPEECH_LOST, NO_DATA etc etc */
+ unsigned mcp:2; /**< mode-change-periode (1 or 2) */
+ unsigned mcc:2; /**< mode-change-capability (1 or 2) */
+ unsigned mcn:1; /**< mode-change-neighnor (0 or 1) */
+ unsigned crc:1; /**< 0 or 1 */
+ unsigned robust_sorting:1; /**< robust-sorting (0 or 1) */
}
tdav_codec_amr_t;
diff --git a/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h b/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
index e0a0dca..f7ae4b8 100755
--- a/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
+++ b/tinyDAV/include/tinydav/codecs/bfcp/tdav_codec_bfcp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -31,9 +31,8 @@
TDAV_BEGIN_DECLS
/** BFCP codec */
-typedef struct tdav_codec_bfcp_s
-{
- TMEDIA_DECLARE_CODEC_BFCP;
+typedef struct tdav_codec_bfcp_s {
+ TMEDIA_DECLARE_CODEC_BFCP;
}
tdav_codec_bfcp_t;
diff --git a/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h b/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
index 3790a71..3bdf465 100755
--- a/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
+++ b/tinyDAV/include/tinydav/codecs/bv/tdav_codec_bv16.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,21 +40,20 @@
TDAV_BEGIN_DECLS
/** BV16 codec */
-typedef struct tdav_codec_bv16_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_bv16_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- struct {
- void *state;
- void *bs;
- void *x;
- } encoder;
+ struct {
+ void *state;
+ void *bs;
+ void *x;
+ } encoder;
- struct {
- void *state;
- void *bs;
- void *x;
- } decoder;
+ struct {
+ void *state;
+ void *bs;
+ void *x;
+ } decoder;
}
tdav_codec_bv16_t;
diff --git a/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h b/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
index 6082de7..378295f 100755
--- a/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
+++ b/tinyDAV/include/tinydav/codecs/dtmf/tdav_codec_dtmf.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,9 +36,8 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_dtmf_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_dtmf_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_dtmf_t;
diff --git a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
index 80659b8..89ad3a1 100755
--- a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
+++ b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_red.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
index bfd9a50..447c97a 100755
--- a/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
+++ b/tinyDAV/include/tinydav/codecs/fec/tdav_codec_ulpfec.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g711/g711.h b/tinyDAV/include/tinydav/codecs/g711/g711.h
index cb79793..b8aec63 100755
--- a/tinyDAV/include/tinydav/codecs/g711/g711.h
+++ b/tinyDAV/include/tinydav/codecs/g711/g711.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h b/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
index 3343636..8efbead 100755
--- a/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
+++ b/tinyDAV/include/tinydav/codecs/g711/tdav_codec_g711.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,16 +36,14 @@
TDAV_BEGIN_DECLS
/** G.711u codec */
-typedef struct tdav_codec_g711u_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_g711u_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_g711u_t;
/** G.711a codec */
-typedef struct tdav_codec_g711a_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_g711a_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
}
tdav_codec_g711a_t;
diff --git a/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h b/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
index efa45ec..a2bc999 100755
--- a/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
+++ b/tinyDAV/include/tinydav/codecs/g722/g722_enc_dec.h
@@ -7,7 +7,7 @@
*
* Copyright (C) 2005 Steve Underwood
*
- * Despite my general liking of the GPL, I place my own contributions
+ * Despite my general liking of the GPL, I place my own contributions
* to this code in the public domain for the benefit of all mankind -
* even the slimy ones who might try to proprietize my work and use it
* to my detriment.
@@ -49,14 +49,12 @@ codec is considerably faster, and still fully compatible with wideband terminals
#define TDAV_INT16_MAX 32767
#define TDAV_INT16_MIN -32768
-enum
-{
+enum {
G722_SAMPLE_RATE_8000 = 0x0001,
G722_PACKED = 0x0002
};
-typedef struct
-{
+typedef struct {
/*! TRUE if the operating in the special ITU test mode, with the band split filters
disabled. */
int itu_test_mode;
@@ -70,8 +68,7 @@ typedef struct
/*! Signal history for the QMF */
int x[24];
- struct
- {
+ struct {
int s;
int sp;
int sz;
@@ -93,8 +90,7 @@ typedef struct
int out_bits;
} g722_encode_state_t;
-typedef struct
-{
+typedef struct {
/*! TRUE if the operating in the special ITU test mode, with the band split filters
disabled. */
int itu_test_mode;
@@ -108,8 +104,7 @@ typedef struct
/*! Signal history for the QMF */
int x[24];
- struct
- {
+ struct {
int s;
int sp;
int sz;
@@ -124,7 +119,7 @@ typedef struct
int nb;
int det;
} band[2];
-
+
unsigned int in_buffer;
int in_bits;
unsigned int out_buffer;
diff --git a/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h b/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
index 6484022..d710a7a 100755
--- a/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
+++ b/tinyDAV/include/tinydav/codecs/g722/tdav_codec_g722.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h b/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
index 3b4ec05..6517f74 100755
--- a/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
+++ b/tinyDAV/include/tinydav/codecs/g729/tdav_codec_g729.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,30 +43,29 @@
TDAV_BEGIN_DECLS
/** G.729abb codec */
-typedef struct tdav_codec_g729ab_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- struct{
- Word16 prm[PRM_SIZE+1]; /* Analysis parameters + frame type */
- Word16 serial[SERIAL_SIZE]; /* Output bitstream buffer */
-
- Word16 frame; /* frame counter */
-
- /* For G.729B */
- Word16 vad_enable;
- } encoder;
-
- struct{
- Word16 serial[SERIAL_SIZE]; /* Serial stream */
- Word16 synth_buf[L_FRAME+M], *synth; /* Synthesis */
- Word16 parm[PRM_SIZE+2]; /* Synthesis parameters */
- Word16 Az_dec[MP1*2]; /* Decoded Az for post-filter */
- Word16 T2[2]; /* Pitch lag for 2 subframes */
-
- /* For G.729B */
- Word16 Vad;
- } decoder;
+typedef struct tdav_codec_g729ab_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ struct {
+ Word16 prm[PRM_SIZE+1]; /* Analysis parameters + frame type */
+ Word16 serial[SERIAL_SIZE]; /* Output bitstream buffer */
+
+ Word16 frame; /* frame counter */
+
+ /* For G.729B */
+ Word16 vad_enable;
+ } encoder;
+
+ struct {
+ Word16 serial[SERIAL_SIZE]; /* Serial stream */
+ Word16 synth_buf[L_FRAME+M], *synth; /* Synthesis */
+ Word16 parm[PRM_SIZE+2]; /* Synthesis parameters */
+ Word16 Az_dec[MP1*2]; /* Decoded Az for post-filter */
+ Word16 T2[2]; /* Pitch lag for 2 subframes */
+
+ /* For G.729B */
+ Word16 Vad;
+ } decoder;
}
tdav_codec_g729ab_t;
diff --git a/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h b/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
index 1fff744..64c1136 100755
--- a/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
+++ b/tinyDAV/include/tinydav/codecs/gsm/tdav_codec_gsm.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -41,12 +41,11 @@
TDAV_BEGIN_DECLS
/** GSM codec */
-typedef struct tdav_codec_gsm_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_gsm_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- gsm encoder;
- gsm decoder;
+ gsm encoder;
+ gsm decoder;
}
tdav_codec_gsm_t;
diff --git a/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h b/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
index 7f66a3a..f871efd 100755
--- a/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
+++ b/tinyDAV/include/tinydav/codecs/h261/tdav_codec_h261.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -44,34 +44,33 @@ TDAV_BEGIN_DECLS
#define TDAV_CODEC_H261(self) ((tdav_codec_h261_t*)(self))
/** H.2261 codec */
-typedef struct tdav_codec_h261_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
-
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
-
- // Encoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
- void* buffer;
- } encoder;
-
- // decoder
- struct{
- AVCodec* codec;
- AVCodecContext* context;
- AVFrame* picture;
-
- void* accumulator;
- uint8_t ebit;
- tsk_size_t accumulator_pos;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_h261_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
+
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
+
+ // Encoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+ void* buffer;
+ } encoder;
+
+ // decoder
+ struct {
+ AVCodec* codec;
+ AVCodecContext* context;
+ AVFrame* picture;
+
+ void* accumulator;
+ uint8_t ebit;
+ tsk_size_t accumulator_pos;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h261_t;
diff --git a/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h b/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
index 6a2880f..b8a4abd 100755
--- a/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
+++ b/tinyDAV/include/tinydav/codecs/h263/tdav_codec_h263.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
index 9de6fdd..57da492 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -46,7 +46,7 @@ tsk_bool_t tdav_codec_passthrough_h264_is_supported();
static inline tsk_bool_t tdav_codec_h264_is_ffmpeg_plugin(const tmedia_codec_plugin_def_t *plugin)
{
- return(plugin && ((plugin == tdav_codec_h264_base_plugin_def_t) || (plugin == tdav_codec_h264_main_plugin_def_t)));
+ return(plugin && ((plugin == tdav_codec_h264_base_plugin_def_t) || (plugin == tdav_codec_h264_main_plugin_def_t)));
}
TDAV_END_DECLS
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
index b464f12..bcd143b 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cisco.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2014-2015 Mamadou DIOP.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
index 1cf2e97..b2e01ba 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_common.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -90,47 +90,44 @@ static const int32_t H264_LEVEL_TO_ZERO_BASED_INDEX[255] = {
};
// Because of FD, declare it here
-typedef enum packetization_mode_e{
- Unknown_Mode = -1,
- Single_NAL_Unit_Mode = 0, /* Single NAL mode (Only nals from 1-23 are allowed) */
- Non_Interleaved_Mode = 1, /* Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed */
- Interleaved_Mode = 2 /* 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A), and 29 (FU-B) are allowed.*/
+typedef enum packetization_mode_e {
+ Unknown_Mode = -1,
+ Single_NAL_Unit_Mode = 0, /* Single NAL mode (Only nals from 1-23 are allowed) */
+ Non_Interleaved_Mode = 1, /* Non-interleaved Mode: 1-23, 24 (STAP-A), 28 (FU-A) are allowed */
+ Interleaved_Mode = 2 /* 25 (STAP-B), 26 (MTAP16), 27 (MTAP24), 28 (FU-A), and 29 (FU-B) are allowed.*/
}
packetization_mode_t;
-typedef struct tdav_codec_h264_common_s
-{
- TMEDIA_DECLARE_CODEC_VIDEO;
+typedef struct tdav_codec_h264_common_s {
+ TMEDIA_DECLARE_CODEC_VIDEO;
- profile_idc_t profile;
- uint8_t profile_iop;
- level_idc_t level;
- unsigned maxFS;
+ profile_idc_t profile;
+ uint8_t profile_iop;
+ level_idc_t level;
+ unsigned maxFS;
- packetization_mode_t pack_mode_remote; // remote packetization mode
- packetization_mode_t pack_mode_local; // local packetization mode
+ packetization_mode_t pack_mode_remote; // remote packetization mode
+ packetization_mode_t pack_mode_local; // local packetization mode
- struct{
- uint8_t* ptr;
- tsk_size_t size;
- } rtp;
+ struct {
+ uint8_t* ptr;
+ tsk_size_t size;
+ } rtp;
}
tdav_codec_h264_common_t;
#define TDAV_CODEC_H264_COMMON(self) ((tdav_codec_h264_common_t*)(self))
#define TDAV_DECLARE_CODEC_H264_COMMON tdav_codec_h264_common_t __video__
-typedef struct tdav_codec_h264_common_level_size_xs
-{
- level_idc_t level;
- unsigned width;
+typedef struct tdav_codec_h264_common_level_size_xs {
+ level_idc_t level;
+ unsigned width;
unsigned height;
- unsigned maxFS; // From "Table A-1 – Level limits"
+ unsigned maxFS; // From "Table A-1 – Level limits"
}
tdav_codec_h264_common_level_size_xt;
-static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_sizes [] =
-{
- {level_idc_1_0, 128, 96, 99},
+static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_sizes [] = {
+ {level_idc_1_0, 128, 96, 99},
#if 0
{level_idc_1_b, 128, 96, 99},
#endif
@@ -153,278 +150,289 @@ static const tdav_codec_h264_common_level_size_xt tdav_codec_h264_common_level_s
static int tdav_codec_h264_common_size_from_level(level_idc_t level, unsigned *width, unsigned *height)
{
- tsk_size_t i;
- for(i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i){
- if(tdav_codec_h264_common_level_sizes[i].level == level){
- *width = tdav_codec_h264_common_level_sizes[i].width;
- *height = tdav_codec_h264_common_level_sizes[i].height;
- return 0;
- }
- }
- return -1;
+ tsk_size_t i;
+ for(i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i) {
+ if(tdav_codec_h264_common_level_sizes[i].level == level) {
+ *width = tdav_codec_h264_common_level_sizes[i].width;
+ *height = tdav_codec_h264_common_level_sizes[i].height;
+ return 0;
+ }
+ }
+ return -1;
}
static int tdav_codec_h264_common_size_from_fs(unsigned maxFS, unsigned *width, unsigned *height)
{
- tsk_size_t i;
- int ret = -1;
- for (i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i){
- if (tdav_codec_h264_common_level_sizes[i].maxFS <= maxFS){
- *width = tdav_codec_h264_common_level_sizes[i].width;
- *height = tdav_codec_h264_common_level_sizes[i].height;
- ret = 0;
- }
- else {
- break;
- }
- }
- return ret;
+ tsk_size_t i;
+ int ret = -1;
+ for (i = 0; i < sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]); ++i) {
+ if (tdav_codec_h264_common_level_sizes[i].maxFS <= maxFS) {
+ *width = tdav_codec_h264_common_level_sizes[i].width;
+ *height = tdav_codec_h264_common_level_sizes[i].height;
+ ret = 0;
+ }
+ else {
+ break;
+ }
+ }
+ return ret;
}
static int tdav_codec_h264_common_level_from_size(unsigned width, unsigned height, level_idc_t *level)
{
- tsk_size_t i;
- unsigned maxFS = (((width + 15) >> 4) * ((height + 15) >> 4));
- static const tsk_size_t __tdav_codec_h264_common_level_sizes_count = sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]);
- for (i = 0; i < __tdav_codec_h264_common_level_sizes_count; ++i){
- if (/*tdav_codec_h264_common_level_sizes[i].maxFS*/ ((tdav_codec_h264_common_level_sizes[i].width * tdav_codec_h264_common_level_sizes[i].height) >> 8) >= maxFS){
- *level = tdav_codec_h264_common_level_sizes[i].level;
- return 0;
- }
- }
- TSK_DEBUG_WARN("Failed to find default level for size=(%ux%u)", width, height);
- *level = tdav_codec_h264_common_level_sizes[__tdav_codec_h264_common_level_sizes_count - 1].level;
- return 0;
+ tsk_size_t i;
+ unsigned maxFS = (((width + 15) >> 4) * ((height + 15) >> 4));
+ static const tsk_size_t __tdav_codec_h264_common_level_sizes_count = sizeof(tdav_codec_h264_common_level_sizes)/sizeof(tdav_codec_h264_common_level_sizes[0]);
+ for (i = 0; i < __tdav_codec_h264_common_level_sizes_count; ++i) {
+ if (/*tdav_codec_h264_common_level_sizes[i].maxFS*/ ((tdav_codec_h264_common_level_sizes[i].width * tdav_codec_h264_common_level_sizes[i].height) >> 8) >= maxFS) {
+ *level = tdav_codec_h264_common_level_sizes[i].level;
+ return 0;
+ }
+ }
+ TSK_DEBUG_WARN("Failed to find default level for size=(%ux%u)", width, height);
+ *level = tdav_codec_h264_common_level_sizes[__tdav_codec_h264_common_level_sizes_count - 1].level;
+ return 0;
}
static int tdav_codec_h264_common_init(tdav_codec_h264_common_t * h264)
{
- if (h264) {
- level_idc_t level;
- // because at this step 'tmedia_codec_init()' is not called yet and we need default size to compute the H.264 level
- if (TMEDIA_CODEC_VIDEO(h264)->out.width == 0 || TMEDIA_CODEC_VIDEO(h264)->in.width == 0) {
- unsigned width, height;
- tmedia_pref_video_size_t pref_size = tmedia_defaults_get_pref_video_size();
- if (tmedia_video_get_size(pref_size, &width, &height) == 0) {
- TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width;
- TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height;
- }
- }
- h264->maxFS = (((TMEDIA_CODEC_VIDEO(h264)->out.width + 15) >> 4) * ((TMEDIA_CODEC_VIDEO(h264)->out.height + 15) >> 4));
- if ((tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height, &level)) == 0){
- h264->maxFS = TSK_MIN((int32_t)h264->maxFS, MaxFS[H264_LEVEL_TO_ZERO_BASED_INDEX[level]]);
- h264->level = level;
- }
- h264->profile_iop = 0x80;
- h264->pack_mode_local = H264_PACKETIZATION_MODE;
- h264->pack_mode_remote = Unknown_Mode;
- }
- return 0;
+ if (h264) {
+ level_idc_t level;
+ // because at this step 'tmedia_codec_init()' is not called yet and we need default size to compute the H.264 level
+ if (TMEDIA_CODEC_VIDEO(h264)->out.width == 0 || TMEDIA_CODEC_VIDEO(h264)->in.width == 0) {
+ unsigned width, height;
+ tmedia_pref_video_size_t pref_size = tmedia_defaults_get_pref_video_size();
+ if (tmedia_video_get_size(pref_size, &width, &height) == 0) {
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height;
+ }
+ }
+ h264->maxFS = (((TMEDIA_CODEC_VIDEO(h264)->out.width + 15) >> 4) * ((TMEDIA_CODEC_VIDEO(h264)->out.height + 15) >> 4));
+ if ((tdav_codec_h264_common_level_from_size(TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height, &level)) == 0) {
+ h264->maxFS = TSK_MIN((int32_t)h264->maxFS, MaxFS[H264_LEVEL_TO_ZERO_BASED_INDEX[level]]);
+ h264->level = level;
+ }
+ h264->profile_iop = 0x80;
+ h264->pack_mode_local = H264_PACKETIZATION_MODE;
+ h264->pack_mode_remote = Unknown_Mode;
+ }
+ return 0;
}
static int tdav_codec_h264_common_deinit(tdav_codec_h264_common_t * h264)
{
- TSK_DEBUG_INFO("tdav_codec_h264_common_deinit");
- if(h264){
- tmedia_codec_video_deinit(TMEDIA_CODEC_VIDEO(h264));
- TSK_FREE(h264->rtp.ptr);
- h264->rtp.size = 0;
- }
- return 0;
+ TSK_DEBUG_INFO("tdav_codec_h264_common_deinit");
+ if(h264) {
+ tmedia_codec_video_deinit(TMEDIA_CODEC_VIDEO(h264));
+ TSK_FREE(h264->rtp.ptr);
+ h264->rtp.size = 0;
+ }
+ return 0;
}
static int tdav_codec_h264_common_get_profile_and_level(const char* fmtp, profile_idc_t *profile, level_idc_t *level)
{
- tsk_size_t size = tsk_strlen(fmtp);
- int start, end;
- int ret = -1;
-
- *profile = profile_idc_none;
- *level = level_idc_none;
-
- if((start = tsk_strindexOf(fmtp, size, "profile-level-id")) !=-1){
- tsk_param_t* param;
- if((end = (int)tsk_strindexOf((fmtp+start), (tsk_size_t)(size-start), ";")) == -1){
- end = (int)size;
- }
-
- if((param = tsk_params_parse_param((fmtp+start), (end-start)))){
- profile_idc_t p_idc;
- level_idc_t l_idc;
- if(param->value){
- tsk_strtrim_both(&param->value);
- }
-
- tdav_codec_h264_parse_profile(param->value, &p_idc, tsk_null, &l_idc);
-
- switch(p_idc){
- case profile_idc_baseline:
- case profile_idc_main:
- *profile = p_idc;
- *level = l_idc;
- ret = 0;
- break;
- case profile_idc_extended:
- case profile_idc_high:
- default:
- /* Not supported */
- break;
- }
-
- TSK_OBJECT_SAFE_FREE(param);
- }
- }
- return ret;
+ tsk_size_t size = tsk_strlen(fmtp);
+ int start, end;
+ int ret = -1;
+
+ *profile = profile_idc_none;
+ *level = level_idc_none;
+
+ if((start = tsk_strindexOf(fmtp, size, "profile-level-id")) !=-1) {
+ tsk_param_t* param;
+ if((end = (int)tsk_strindexOf((fmtp+start), (tsk_size_t)(size-start), ";")) == -1) {
+ end = (int)size;
+ }
+
+ if((param = tsk_params_parse_param((fmtp+start), (end-start)))) {
+ profile_idc_t p_idc;
+ level_idc_t l_idc;
+ if(param->value) {
+ tsk_strtrim_both(&param->value);
+ }
+
+ tdav_codec_h264_parse_profile(param->value, &p_idc, tsk_null, &l_idc);
+
+ switch(p_idc) {
+ case profile_idc_baseline:
+ case profile_idc_main:
+ *profile = p_idc;
+ *level = l_idc;
+ ret = 0;
+ break;
+ case profile_idc_extended:
+ case profile_idc_high:
+ default:
+ /* Not supported */
+ break;
+ }
+
+ TSK_OBJECT_SAFE_FREE(param);
+ }
+ }
+ return ret;
}
static tsk_bool_t tdav_codec_h264_common_sdp_att_match(tdav_codec_h264_common_t* h264, const char* att_name, const char* att_value)
{
- tsk_bool_t ret = tsk_true;
-
- if(!h264){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_false;
- }
-
- TSK_DEBUG_INFO("[H.264] Trying to match [%s:%s]", att_name, att_value);
-
- if (tsk_striequals(att_name, "fmtp")) {
- int val_int;
- profile_idc_t profile;
- level_idc_t level;
- tsk_params_L_t* params;
-
- /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
- if (tdav_codec_h264_common_get_profile_and_level(att_value, &profile, &level) != 0) {
- TSK_DEBUG_ERROR("Not valid profile-level: %s", att_value);
- return tsk_false;
- }
- if (h264->profile != profile) {
- return tsk_false;
- }
- else{
- if (h264->level != level) {
- // change the output size only when the remote party request lower level. If it request higher (or same) level then, we send our preferred size.
- if (h264->level > level) {
- unsigned width, height;
- h264->level = TSK_MIN(h264->level, level);
- if (tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
- return tsk_false;
- }
- // Do not change our size if it match the requested level
- if (width < TMEDIA_CODEC_VIDEO(h264)->out.width || height < TMEDIA_CODEC_VIDEO(h264)->out.height) {
- // Set "out" size. We must not send more than "MaxFS".
- // Default "out" is equal to the preferred sized and initialized in init().
- // "TANDBERG/4120 (X7.2.2)" will terminate the call if frame size > maxFS
- TMEDIA_CODEC_VIDEO(h264)->out.width = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.width, width);
- TMEDIA_CODEC_VIDEO(h264)->out.height = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.height, height);
- }
- // Set default "in". Will be updated after receiving the first frame.
- TMEDIA_CODEC_VIDEO(h264)->in.width = width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = height;
- }
- }
- }
-
- /* e.g. profile-level-id=42e00a; packetization-mode=1; max-br=452; max-mbps=11880 */
- if ((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
-
- /* === max-br ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-br")) != -1) {
- // should compare "max-br"?
- TMEDIA_CODEC_VIDEO(h264)->out.max_br = val_int*1000;
- }
-
- /* === max-fs ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-fs")) != -1) {
- unsigned width_max, height_max, maxFS, currFS;
- currFS = (TMEDIA_CODEC_VIDEO(h264)->out.width * TMEDIA_CODEC_VIDEO(h264)->out.height) >> 8;
- maxFS = TSK_MIN(h264->maxFS/*preferred*/, (unsigned)val_int/*proposed*/); // make sure we'll never send more than we advertised
- if (currFS > maxFS) { // do not use default sizes when we already respect the MaxFS
- if (tdav_codec_h264_common_size_from_fs(maxFS, &width_max, &height_max) == 0) {
- TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width_max;
- TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height_max;
- }
- }
- }
-
- /* === max-mbps ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "max-mbps")) != -1) {
- // should compare "max-mbps"?
- TMEDIA_CODEC_VIDEO(h264)->out.max_mbps = val_int*1000;
- }
-
- /* === packetization-mode ===*/
- if ((val_int = tsk_params_get_param_value_as_int(params, "packetization-mode")) != -1) {
- if ((packetization_mode_t)val_int == Single_NAL_Unit_Mode || (packetization_mode_t)val_int == Non_Interleaved_Mode) {
- TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote = (packetization_mode_t)val_int;
- TDAV_CODEC_H264_COMMON(h264)->pack_mode_local = TSK_MAX(TDAV_CODEC_H264_COMMON(h264)->pack_mode_local, TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote);
- }
- else {
- TSK_DEBUG_INFO("packetization-mode not matching");
- ret = tsk_false;
- goto bail;
- }
- }
- }
+ tsk_bool_t ret = tsk_true;
+ tsk_bool_t outsize_changed = tsk_false;
+
+ if(!h264) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_false;
+ }
+
+ TSK_DEBUG_INFO("[H.264] Trying to match [%s:%s]", att_name, att_value);
+
+ if (tsk_striequals(att_name, "fmtp")) {
+ int val_int;
+ profile_idc_t profile;
+ level_idc_t level;
+ tsk_params_L_t* params;
+
+ /* Check whether the profile match (If the profile is missing, then we consider that it's ok) */
+ if (tdav_codec_h264_common_get_profile_and_level(att_value, &profile, &level) != 0) {
+ TSK_DEBUG_ERROR("Not valid profile-level: %s", att_value);
+ return tsk_false;
+ }
+ if (h264->profile != profile) {
+ return tsk_false;
+ }
+ else {
+ if (h264->level != level) {
+ // change the output size only when the remote party request lower level. If it request higher (or same) level then, we send our preferred size.
+ if (h264->level > level) {
+ unsigned width, height;
+ h264->level = TSK_MIN(h264->level, level);
+ if (tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
+ return tsk_false;
+ }
+ // Do not change our size if it match the requested level
+ if (width < TMEDIA_CODEC_VIDEO(h264)->out.width || height < TMEDIA_CODEC_VIDEO(h264)->out.height) {
+ // Set "out" size. We must not send more than "MaxFS".
+ // Default "out" is equal to the preferred sized and initialized in init().
+ // "TANDBERG/4120 (X7.2.2)" will terminate the call if frame size > maxFS
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.width, width);
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TSK_MIN(TMEDIA_CODEC_VIDEO(h264)->out.height, height);
+ outsize_changed = tsk_true;
+ }
+ // Set default "in". Will be updated after receiving the first frame.
+ TMEDIA_CODEC_VIDEO(h264)->in.width = width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = height;
+ }
+ }
+ }
+
+ /* e.g. profile-level-id=42e00a; packetization-mode=1; max-br=452; max-mbps=11880 */
+ if ((params = tsk_params_fromstring(att_value, ";", tsk_true))) {
+
+ /* === max-br ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-br")) != -1) {
+ // should compare "max-br"?
+ TMEDIA_CODEC_VIDEO(h264)->out.max_br = val_int*1000;
+ }
+
+ /* === max-fs ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-fs")) != -1) {
+ unsigned width_max, height_max, maxFS, currFS;
+ currFS = (TMEDIA_CODEC_VIDEO(h264)->out.width * TMEDIA_CODEC_VIDEO(h264)->out.height) >> 8;
+ maxFS = TSK_MIN(h264->maxFS/*preferred*/, (unsigned)val_int/*proposed*/); // make sure we'll never send more than we advertised
+ if (currFS > maxFS) { // do not use default sizes when we already respect the MaxFS
+ if (tdav_codec_h264_common_size_from_fs(maxFS, &width_max, &height_max) == 0) {
+ TMEDIA_CODEC_VIDEO(h264)->out.width = TMEDIA_CODEC_VIDEO(h264)->in.width = width_max;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = TMEDIA_CODEC_VIDEO(h264)->in.height = height_max;
+ outsize_changed = tsk_true;
+ }
+ }
+ }
+
+ /* === max-mbps ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "max-mbps")) != -1) {
+ // should compare "max-mbps"?
+ TMEDIA_CODEC_VIDEO(h264)->out.max_mbps = val_int*1000;
+ }
+
+ /* === packetization-mode ===*/
+ if ((val_int = tsk_params_get_param_value_as_int(params, "packetization-mode")) != -1) {
+ if ((packetization_mode_t)val_int == Single_NAL_Unit_Mode || (packetization_mode_t)val_int == Non_Interleaved_Mode) {
+ TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote = (packetization_mode_t)val_int;
+ TDAV_CODEC_H264_COMMON(h264)->pack_mode_local = TSK_MAX(TDAV_CODEC_H264_COMMON(h264)->pack_mode_local, TDAV_CODEC_H264_COMMON(h264)->pack_mode_remote);
+ }
+ else {
+ TSK_DEBUG_INFO("packetization-mode not matching");
+ ret = tsk_false;
+ goto bail;
+ }
+ }
+ }
bail:
- TSK_OBJECT_SAFE_FREE(params);
- }
- else if(tsk_striequals(att_name, "imageattr")){
- unsigned in_width, in_height, out_width, out_height;
- unsigned width, height;
- tsk_size_t s;
- if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(h264)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0){
- return tsk_false;
- }
- // check that 'imageattr' is comform to H.264 'profile-level'
- if(tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0){
- return tsk_false;
- }
- if((s = ((width * height * 3) >> 1)) < ((in_width * in_height * 3) >> 1) || s < ((out_width * out_height * 3) >> 1)){
- return tsk_false;
- }
-
- TMEDIA_CODEC_VIDEO(h264)->in.width = in_width;
- TMEDIA_CODEC_VIDEO(h264)->in.height = in_height;
- TMEDIA_CODEC_VIDEO(h264)->out.width = out_width;
- TMEDIA_CODEC_VIDEO(h264)->out.height = out_height;
- }
-
- return ret;
+ TSK_OBJECT_SAFE_FREE(params);
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ unsigned in_width, in_height, out_width, out_height;
+ unsigned width, height;
+ tsk_size_t s;
+ if(tmedia_parse_video_imageattr(att_value, TMEDIA_CODEC_VIDEO(h264)->pref_size, &in_width, &in_height, &out_width, &out_height) != 0) {
+ return tsk_false;
+ }
+ // check that 'imageattr' is comform to H.264 'profile-level'
+ if(tdav_codec_h264_common_size_from_level(h264->level, &width, &height) != 0) {
+ return tsk_false;
+ }
+ if((s = ((width * height * 3) >> 1)) < ((in_width * in_height * 3) >> 1) || s < ((out_width * out_height * 3) >> 1)) {
+ return tsk_false;
+ }
+
+ TMEDIA_CODEC_VIDEO(h264)->in.width = in_width;
+ TMEDIA_CODEC_VIDEO(h264)->in.height = in_height;
+ TMEDIA_CODEC_VIDEO(h264)->out.width = out_width;
+ TMEDIA_CODEC_VIDEO(h264)->out.height = out_height;
+ outsize_changed = tsk_true;
+ }
+
+ // clamp the output size to the defined max range
+ if (outsize_changed && tmedia_defaults_get_adapt_video_size_range_enabled()) {
+ if (tmedia_codec_video_clamp_out_size_to_range_max(TMEDIA_CODEC_VIDEO(h264)) != 0) {
+ ret = tsk_false;
+ }
+ }
+
+ return ret;
}
static char* tdav_codec_h264_common_sdp_att_get(const tdav_codec_h264_common_t* h264, const char* att_name)
-{
- if(!h264 || !att_name){
- TSK_DEBUG_ERROR("Invalid parameter");
- return tsk_null;
- }
-
- if (tsk_striequals(att_name, "fmtp")) {
- char* fmtp = tsk_null;
+{
+ if(!h264 || !att_name) {
+ TSK_DEBUG_ERROR("Invalid parameter");
+ return tsk_null;
+ }
+
+ if (tsk_striequals(att_name, "fmtp")) {
+ char* fmtp = tsk_null;
#if 1
- // Required by "TANDBERG/4120 (X7.2.2)" and CISCO TelePresence
- tsk_sprintf(&fmtp, "profile-level-id=%x;max-mbps=%d;max-fs=%d",
- ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)),
- MaxMBPS[H264_LEVEL_TO_ZERO_BASED_INDEX[h264->level]],
- h264->maxFS
- );
- // Do not restrict packetisation-mode until we knwon what the remote party supports
- if (h264->pack_mode_remote != Unknown_Mode) {
- tsk_strcat_2(&fmtp, ";packetization-mode=%d", h264->pack_mode_local);
- }
+ // Required by "TANDBERG/4120 (X7.2.2)" and CISCO TelePresence
+ tsk_sprintf(&fmtp, "profile-level-id=%x;max-mbps=%d;max-fs=%d",
+ ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)),
+ MaxMBPS[H264_LEVEL_TO_ZERO_BASED_INDEX[h264->level]],
+ h264->maxFS
+ );
+ // Do not restrict packetisation-mode until we knwon what the remote party supports
+ if (h264->pack_mode_remote != Unknown_Mode) {
+ tsk_strcat_2(&fmtp, ";packetization-mode=%d", h264->pack_mode_local);
+ }
#else
- tsk_sprintf(&fmtp, "profile-level-id=%x; packetization-mode=%d", ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)), h264->pack_mode);
+ tsk_sprintf(&fmtp, "profile-level-id=%x; packetization-mode=%d", ((h264->profile << 16) | (h264->profile_iop << 8) | (h264->level & 0xff)), h264->pack_mode);
#endif
- return fmtp;
- }
- else if(tsk_striequals(att_name, "imageattr")){
- return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(h264)->pref_size,
- TMEDIA_CODEC_VIDEO(h264)->in.width, TMEDIA_CODEC_VIDEO(h264)->in.height, TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height);
- }
- return tsk_null;
+ return fmtp;
+ }
+ else if(tsk_striequals(att_name, "imageattr")) {
+ return tmedia_get_video_imageattr(TMEDIA_CODEC_VIDEO(h264)->pref_size,
+ TMEDIA_CODEC_VIDEO(h264)->in.width, TMEDIA_CODEC_VIDEO(h264)->in.height, TMEDIA_CODEC_VIDEO(h264)->out.width, TMEDIA_CODEC_VIDEO(h264)->out.height);
+ }
+ return tsk_null;
}
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
index 5dfae9c..e42a40d 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_cuda.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011-2014 Mamadou DIOP.
* Copyright (C) 2011-2014 Doubango Telecom <http://www.doubango.org>.
*
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -69,38 +69,37 @@ typedef struct NVEncoderParams NVEncoderParams;
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_h264_cuda_s
-{
- TDAV_DECLARE_CODEC_H264_COMMON;
-
- struct {
- NVEncoder context;
- NVEncoderParams ctx_params;
- NVVE_CallbackParams clb_params;
- void *buffer;
- tsk_size_t buffer_size;
- int64_t frame_count;
- } encoder;
-
- struct {
- tsk_mutex_handle_t *mutex;
- CUvideodecoder context;
- CUVIDDECODECREATEINFO info;
- CUvideoparser cu_parser;
- CUVIDPARSERPARAMS cu_paser_params;
- CUdevice cu_device;
- IDirect3D9 *dx_d3d;
- IDirect3DDevice9 *dx_d3ddevice;
- CUcontext cu_context;
- void* accumulator;
- tsk_size_t accumulator_pos;
- tsk_size_t accumulator_size;
- void *cu_buffer;
- tsk_size_t cu_buffer_size;
- tsk_size_t cu_buffer_pitch;
- tsk_bool_t cu_buffer_avail;
- uint16_t last_seq;
- } decoder;
+typedef struct tdav_codec_h264_cuda_s {
+ TDAV_DECLARE_CODEC_H264_COMMON;
+
+ struct {
+ NVEncoder context;
+ NVEncoderParams ctx_params;
+ NVVE_CallbackParams clb_params;
+ void *buffer;
+ tsk_size_t buffer_size;
+ int64_t frame_count;
+ } encoder;
+
+ struct {
+ tsk_mutex_handle_t *mutex;
+ CUvideodecoder context;
+ CUVIDDECODECREATEINFO info;
+ CUvideoparser cu_parser;
+ CUVIDPARSERPARAMS cu_paser_params;
+ CUdevice cu_device;
+ IDirect3D9 *dx_d3d;
+ IDirect3DDevice9 *dx_d3ddevice;
+ CUcontext cu_context;
+ void* accumulator;
+ tsk_size_t accumulator_pos;
+ tsk_size_t accumulator_size;
+ void *cu_buffer;
+ tsk_size_t cu_buffer_size;
+ tsk_size_t cu_buffer_pitch;
+ tsk_bool_t cu_buffer_avail;
+ uint16_t last_seq;
+ } decoder;
}
tdav_codec_h264_cuda_t;
@@ -111,10 +110,10 @@ TINYDAV_GEXTERN const tmedia_codec_plugin_def_t *tdav_codec_h264_cuda_bp30_plugi
tsk_bool_t tdav_codec_h264_cuda_is_supported();
static inline tsk_bool_t tdav_codec_h264_is_cuda_plugin(const tmedia_codec_plugin_def_t *plugin)
{
- if(plugin && (plugin == tdav_codec_h264_cuda_bp10_plugin_def_t || plugin == tdav_codec_h264_cuda_bp20_plugin_def_t || plugin == tdav_codec_h264_cuda_bp30_plugin_def_t)){
- return tsk_true;
- }
- return tsk_false;
+ if(plugin && (plugin == tdav_codec_h264_cuda_bp10_plugin_def_t || plugin == tdav_codec_h264_cuda_bp20_plugin_def_t || plugin == tdav_codec_h264_cuda_bp30_plugin_def_t)) {
+ return tsk_true;
+ }
+ return tsk_false;
}
TDAV_END_DECLS
diff --git a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
index 88796e4..23c3cc8 100755
--- a/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
+++ b/tinyDAV/include/tinydav/codecs/h264/tdav_codec_h264_rtp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -47,48 +47,48 @@ struct tdav_codec_h264_common_s;
extern uint8_t H264_START_CODE_PREFIX[4];
typedef enum profile_idc_e {
- profile_idc_none = 0,
+ profile_idc_none = 0,
- profile_idc_baseline = 66,
- profile_idc_extended = 88,
- profile_idc_main = 77,
- profile_idc_high = 100
+ profile_idc_baseline = 66,
+ profile_idc_extended = 88,
+ profile_idc_main = 77,
+ profile_idc_high = 100
}
profile_idc_t;
typedef struct profile_iop_s {
- unsigned constraint_set0_flag:1;
- unsigned constraint_set1_flag:1;
- unsigned constraint_set2_flag:1;
- unsigned reserved_zero_5bits:5;
+ unsigned constraint_set0_flag:1;
+ unsigned constraint_set1_flag:1;
+ unsigned constraint_set2_flag:1;
+ unsigned reserved_zero_5bits:5;
}
profile_iop_t;
typedef enum level_idc_e {
- level_idc_none = 0,
-
- level_idc_1_0 = 10,
- level_idc_1_b = 14,
- level_idc_1_1 = 11,
- level_idc_1_2 = 12,
- level_idc_1_3 = 13,
- level_idc_2_0 = 20,
- level_idc_2_1 = 21,
- level_idc_2_2 = 22,
- level_idc_3_0 = 30,
- level_idc_3_1 = 31,
- level_idc_3_2 = 32,
- level_idc_4_0 = 40,
- level_idc_4_1 = 41,
- level_idc_4_2 = 42,
- level_idc_5_0 = 50,
- level_idc_5_1 = 51,
- level_idc_5_2 = 52,
+ level_idc_none = 0,
+
+ level_idc_1_0 = 10,
+ level_idc_1_b = 14,
+ level_idc_1_1 = 11,
+ level_idc_1_2 = 12,
+ level_idc_1_3 = 13,
+ level_idc_2_0 = 20,
+ level_idc_2_1 = 21,
+ level_idc_2_2 = 22,
+ level_idc_3_0 = 30,
+ level_idc_3_1 = 31,
+ level_idc_3_2 = 32,
+ level_idc_4_0 = 40,
+ level_idc_4_1 = 41,
+ level_idc_4_2 = 42,
+ level_idc_5_0 = 50,
+ level_idc_5_1 = 51,
+ level_idc_5_2 = 52,
}
level_idc_t;
-/* 5.2. Common Structure of the RTP Payload Format
+/* 5.2. Common Structure of the RTP Payload Format
Type Packet Type name Section
---------------------------------------------------------
0 undefined -
@@ -101,17 +101,17 @@ level_idc_t;
29 FU-B Fragmentation unit 5.8
30-31 undefined -
*/
-typedef enum nal_unit_type_e{
+typedef enum nal_unit_type_e {
undefined_0 = 0,
nal_unit,
stap_a = 24,
stap_b = 25,
mtap16 = 26,
- mtap24 = 27,
- fu_a = 28,
+ mtap24 = 27,
+ fu_a = 28,
fu_b = 29,
- undefined_30 = 30,
- undefined_31 = 31
+ undefined_30 = 30,
+ undefined_31 = 31
}
nal_unit_type_t;
diff --git a/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h b/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
index 4a48fad..ff66bba 100755
--- a/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
+++ b/tinyDAV/include/tinydav/codecs/ilbc/tdav_codec_ilbc.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -43,15 +43,14 @@
TDAV_BEGIN_DECLS
/** iLBC codec */
-typedef struct tdav_codec_ilbc_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
+typedef struct tdav_codec_ilbc_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
- iLBC_Enc_Inst_t encoder;
- iLBC_Dec_Inst_t decoder;
+ iLBC_Enc_Inst_t encoder;
+ iLBC_Dec_Inst_t decoder;
- float encblock[BLOCKL_MAX];
- float decblock[BLOCKL_MAX];
+ float encblock[BLOCKL_MAX];
+ float decblock[BLOCKL_MAX];
}
tdav_codec_ilbc_t;
diff --git a/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h b/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
index c7bf35a..a159bd8 100755
--- a/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
+++ b/tinyDAV/include/tinydav/codecs/mp4ves/tdav_codec_mp4ves.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h b/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
index 702c872..e7a908c 100755
--- a/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
+++ b/tinyDAV/include/tinydav/codecs/msrp/tdav_codec_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,9 +32,8 @@
TDAV_BEGIN_DECLS
/** MSRP codec */
-typedef struct tdav_codec_msrp_s
-{
- TMEDIA_DECLARE_CODEC_MSRP;
+typedef struct tdav_codec_msrp_s {
+ TMEDIA_DECLARE_CODEC_MSRP;
}
tdav_codec_msrp_t;
diff --git a/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h b/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
index c505f6d..eb94c7f 100755
--- a/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
+++ b/tinyDAV/include/tinydav/codecs/opus/tdav_codec_opus.h
@@ -7,12 +7,12 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h b/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
index b577f02..b946878 100755
--- a/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
+++ b/tinyDAV/include/tinydav/codecs/speex/tdav_codec_speex.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -36,37 +36,35 @@
#include "tinymedia/tmedia_codec.h"
-#include <speex/speex.h>
+#include <speex/speex.h>
TDAV_BEGIN_DECLS
-typedef enum tdav_codec_speex_type_e
-{
- tdav_codec_speex_type_nb,
- tdav_codec_speex_type_wb,
- tdav_codec_speex_type_uwb,
+typedef enum tdav_codec_speex_type_e {
+ tdav_codec_speex_type_nb,
+ tdav_codec_speex_type_wb,
+ tdav_codec_speex_type_uwb,
}
tdav_codec_speex_type_t;
/** Speex codec */
-typedef struct tdav_codec_speex_s
-{
- TMEDIA_DECLARE_CODEC_AUDIO;
-
- tdav_codec_speex_type_t type;
-
- struct{
- void* state;
- SpeexBits bits;
- tsk_size_t size;
- } encoder;
-
- struct {
- void* state;
- SpeexBits bits;
- spx_int16_t* buffer;
- tsk_size_t size;
- } decoder;
+typedef struct tdav_codec_speex_s {
+ TMEDIA_DECLARE_CODEC_AUDIO;
+
+ tdav_codec_speex_type_t type;
+
+ struct {
+ void* state;
+ SpeexBits bits;
+ tsk_size_t size;
+ } encoder;
+
+ struct {
+ void* state;
+ SpeexBits bits;
+ spx_int16_t* buffer;
+ tsk_size_t size;
+ } decoder;
}
tdav_codec_speex_t;
diff --git a/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h b/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
index 1b6d3c2..4fabfe5 100755
--- a/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
+++ b/tinyDAV/include/tinydav/codecs/t140/tdav_codec_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -30,9 +30,8 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_codec_t140_s
-{
- TMEDIA_DECLARE_CODEC;
+typedef struct tdav_codec_t140_s {
+ TMEDIA_DECLARE_CODEC;
}
tdav_codec_t140_t;
diff --git a/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h b/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
index e0614ed..90d0428 100755
--- a/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
+++ b/tinyDAV/include/tinydav/codecs/theora/tdav_codec_theora.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h b/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
index 38580ad..7424ffb 100755
--- a/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
+++ b/tinyDAV/include/tinydav/codecs/vpx/tdav_codec_vp8.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(dot)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
index d46a345..33db094 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_consumer_msrp.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,9 +39,8 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_MSRP(self) ((tdav_consumer_msrp_t*)(self))
-typedef struct tdav_consumer_msrp_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_msrp_s {
+ TMEDIA_DECLARE_CONSUMER;
}
tdav_consumer_msrp_t;
diff --git a/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
index df85248..4dc6178 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_producer_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h b/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
index 6626ea9..7ee16b5 100755
--- a/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
+++ b/tinyDAV/include/tinydav/msrp/tdav_session_msrp.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2010-2011 Mamadou Diop.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -40,66 +40,63 @@
TDAV_BEGIN_DECLS
-typedef enum tdav_msrp_setup_e
-{
- msrp_setup_active,
- msrp_setup_passive,
- msrp_setup_actpass,
- msrp_setup_holdconn
+typedef enum tdav_msrp_setup_e {
+ msrp_setup_active,
+ msrp_setup_passive,
+ msrp_setup_actpass,
+ msrp_setup_holdconn
}
tdav_msrp_setup_t;
-typedef enum tdav_msrp_dir_e
-{
- tdav_msrp_dir_none = 0x00,
- tdav_msrp_dir_sendonly = 0x01 << 0,
- tdav_msrp_dir_recvonly = 0x01 << 1,
- tdav_msrp_dir_sendrecv = (tdav_msrp_dir_sendonly | tdav_msrp_dir_recvonly),
+typedef enum tdav_msrp_dir_e {
+ tdav_msrp_dir_none = 0x00,
+ tdav_msrp_dir_sendonly = 0x01 << 0,
+ tdav_msrp_dir_recvonly = 0x01 << 1,
+ tdav_msrp_dir_sendrecv = (tdav_msrp_dir_sendonly | tdav_msrp_dir_recvonly),
}
tdav_msrp_dir_t;
-typedef struct tdav_session_msrp_s
-{
- TMEDIA_DECLARE_SESSION_MSRP;
-
- tsk_bool_t useIPv6;
-
- tnet_transport_t *transport;
- tmsrp_config_t* config;
- tdav_msrp_setup_t setup;
- tnet_fd_t connectedFD; // FullDuplex Socket
- tmsrp_sender_t* sender;
- tmsrp_receiver_t* receiver;
-
- char* local_ip;
- //uint16_t local_port;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* natt_ctx;
-
- char* remote_ip;
- uint16_t remote_port;
-
- tdav_msrp_dir_t dir;
- char* neg_accept_type;
- char* neg_accept_w_type;
- char* accept_types;
- char* accept_w_types;
- uint64_t chunck_duration;
-
- struct {
- char* path; //full-path
- char* selector;
- char* disposition;
- char* date;
- char* icon;
- char* transfer_id;
- unsigned sent:1;
- } file;
-
- unsigned fresh_conn:1;
- unsigned offerer:1;
- unsigned send_bodiless:1;
+typedef struct tdav_session_msrp_s {
+ TMEDIA_DECLARE_SESSION_MSRP;
+
+ tsk_bool_t useIPv6;
+
+ tnet_transport_t *transport;
+ tmsrp_config_t* config;
+ tdav_msrp_setup_t setup;
+ tnet_fd_t connectedFD; // FullDuplex Socket
+ tmsrp_sender_t* sender;
+ tmsrp_receiver_t* receiver;
+
+ char* local_ip;
+ //uint16_t local_port;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* natt_ctx;
+
+ char* remote_ip;
+ uint16_t remote_port;
+
+ tdav_msrp_dir_t dir;
+ char* neg_accept_type;
+ char* neg_accept_w_type;
+ char* accept_types;
+ char* accept_w_types;
+ uint64_t chunck_duration;
+
+ struct {
+ char* path; //full-path
+ char* selector;
+ char* disposition;
+ char* date;
+ char* icon;
+ char* transfer_id;
+ unsigned sent:1;
+ } file;
+
+ unsigned fresh_conn:1;
+ unsigned offerer:1;
+ unsigned send_bodiless:1;
}
tdav_session_msrp_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h b/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
index 822786c..f1c5703 100755
--- a/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_consumer_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,18 +35,17 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_T140(self) ((tdav_consumer_t140_t*)(self))
-typedef struct tdav_consumer_t140_s
-{
- TMEDIA_DECLARE_CONSUMER;
+typedef struct tdav_consumer_t140_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ tsk_bool_t started;
- tsk_bool_t started;
+ struct {
+ const void* context;
+ tmedia_session_t140_ondata_cb_f func;
+ } cb_ondata;
- struct{
- const void* context;
- tmedia_session_t140_ondata_cb_f func;
- } cb_ondata;
-
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_t140_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_producer_t140.h b/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
index 4e47326..51a1a21 100755
--- a/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_producer_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,11 +32,10 @@ TDAV_BEGIN_DECLS
#define TDAV_PRODUCER_T140(self) ((tdav_producer_t140_t*)(self))
-typedef struct tdav_producer_t140_s
-{
- TMEDIA_DECLARE_PRODUCER;
-
- tsk_bool_t started;
+typedef struct tdav_producer_t140_s {
+ TMEDIA_DECLARE_PRODUCER;
+
+ tsk_bool_t started;
}
tdav_producer_t140_t;
diff --git a/tinyDAV/include/tinydav/t140/tdav_session_t140.h b/tinyDAV/include/tinydav/t140/tdav_session_t140.h
index a569d3a..9915708 100755
--- a/tinyDAV/include/tinydav/t140/tdav_session_t140.h
+++ b/tinyDAV/include/tinydav/t140/tdav_session_t140.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,59 +35,58 @@ TDAV_BEGIN_DECLS
typedef tsk_list_t tdav_session_t140_blocks_L_t;
-typedef struct tdav_session_t140_s
-{
- TDAV_DECLARE_SESSION_AV;
-
- tsk_bool_t started;
- tsk_timer_manager_handle_t *h_timer;
-
- struct{
- const void* context;
- tmedia_session_t140_ondata_cb_f func;
- } cb_ondata;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
- tsk_size_t buffer_idx;
-
- void* red_buffer;
- tsk_size_t red_buffer_size;
-
- tdav_session_t140_blocks_L_t* blocks;
- int64_t blocks_count;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_buffering;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_idle;
- } encoder;
-
- struct {
- uint32_t payload_type;
- struct tmedia_codec_s* codec;
-
- void* buffer;
- tsk_size_t buffer_size;
-
- void* consumer_buffer;
- tsk_size_t consumer_buffer_size;
-
- tdav_session_t140_blocks_L_t* blocks;
- int64_t blocks_count;
- int32_t last_seq_num;
- struct{
- tsk_timer_id_t id;
- int64_t timeout;
- }timer_pkt_loss;
- } decoder;
+typedef struct tdav_session_t140_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ tsk_bool_t started;
+ tsk_timer_manager_handle_t *h_timer;
+
+ struct {
+ const void* context;
+ tmedia_session_t140_ondata_cb_f func;
+ } cb_ondata;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+ tsk_size_t buffer_idx;
+
+ void* red_buffer;
+ tsk_size_t red_buffer_size;
+
+ tdav_session_t140_blocks_L_t* blocks;
+ int64_t blocks_count;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_buffering;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_idle;
+ } encoder;
+
+ struct {
+ uint32_t payload_type;
+ struct tmedia_codec_s* codec;
+
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ void* consumer_buffer;
+ tsk_size_t consumer_buffer_size;
+
+ tdav_session_t140_blocks_L_t* blocks;
+ int64_t blocks_count;
+ int32_t last_seq_num;
+ struct {
+ tsk_timer_id_t id;
+ int64_t timeout;
+ } timer_pkt_loss;
+ } decoder;
}
tdav_session_t140_t;
diff --git a/tinyDAV/include/tinydav/tdav.h b/tinyDAV/include/tinydav/tdav.h
index 8318771..d9ec4df 100755
--- a/tinyDAV/include/tinydav/tdav.h
+++ b/tinyDAV/include/tinydav/tdav.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,48 +38,47 @@ TDAV_BEGIN_DECLS
// @tinyWRAP
// @deprecated: to be replaced by "tmedia_codec_id_t" in Doubango 3.0
-typedef enum tdav_codec_id_e
-{
- tdav_codec_id_none = tmedia_codec_id_none,
-
- tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
- tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
- tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
- tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
- tdav_codec_id_gsm = tmedia_codec_id_gsm,
- tdav_codec_id_pcma = tmedia_codec_id_pcma,
- tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
- tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
- tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
- tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
- tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
- tdav_codec_id_bv16 = tmedia_codec_id_bv16,
- tdav_codec_id_bv32 = tmedia_codec_id_bv32,
- tdav_codec_id_opus = tmedia_codec_id_opus,
- tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
- tdav_codec_id_g722 = tmedia_codec_id_g722,
-
- /* room for new Audio codecs */
-
- tdav_codec_id_h261 = tmedia_codec_id_h261,
- tdav_codec_id_h263 = tmedia_codec_id_h263,
- tdav_codec_id_h263p = tmedia_codec_id_h263p,
- tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
- tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
- tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
- tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
- tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
- tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
- tdav_codec_id_theora = tmedia_codec_id_theora,
- tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
- tdav_codec_id_vp8 = tmedia_codec_id_vp8,
+typedef enum tdav_codec_id_e {
+ tdav_codec_id_none = tmedia_codec_id_none,
+
+ tdav_codec_id_amr_nb_oa = tmedia_codec_id_amr_nb_oa,
+ tdav_codec_id_amr_nb_be = tmedia_codec_id_amr_nb_be,
+ tdav_codec_id_amr_wb_oa = tmedia_codec_id_amr_wb_oa,
+ tdav_codec_id_amr_wb_be = tmedia_codec_id_amr_wb_be,
+ tdav_codec_id_gsm = tmedia_codec_id_gsm,
+ tdav_codec_id_pcma = tmedia_codec_id_pcma,
+ tdav_codec_id_pcmu = tmedia_codec_id_pcmu,
+ tdav_codec_id_ilbc = tmedia_codec_id_ilbc,
+ tdav_codec_id_speex_nb = tmedia_codec_id_speex_nb,
+ tdav_codec_id_speex_wb = tmedia_codec_id_speex_wb,
+ tdav_codec_id_speex_uwb = tmedia_codec_id_speex_uwb,
+ tdav_codec_id_bv16 = tmedia_codec_id_bv16,
+ tdav_codec_id_bv32 = tmedia_codec_id_bv32,
+ tdav_codec_id_opus = tmedia_codec_id_opus,
+ tdav_codec_id_g729ab = tmedia_codec_id_g729ab,
+ tdav_codec_id_g722 = tmedia_codec_id_g722,
+
+ /* room for new Audio codecs */
+
+ tdav_codec_id_h261 = tmedia_codec_id_h261,
+ tdav_codec_id_h263 = tmedia_codec_id_h263,
+ tdav_codec_id_h263p = tmedia_codec_id_h263p,
+ tdav_codec_id_h263pp = tmedia_codec_id_h263pp,
+ tdav_codec_id_h264_bp = tmedia_codec_id_h264_bp,
+ tdav_codec_id_h264_mp = tmedia_codec_id_h264_mp,
+ tdav_codec_id_h264_hp = tmedia_codec_id_h264_hp,
+ tdav_codec_id_h264_bp10 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp20 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_bp30 = tmedia_codec_id_h264_bp, // @deprecated
+ tdav_codec_id_h264_svc = tmedia_codec_id_h264_svc,
+ tdav_codec_id_theora = tmedia_codec_id_theora,
+ tdav_codec_id_mp4ves_es = tmedia_codec_id_mp4ves_es,
+ tdav_codec_id_vp8 = tmedia_codec_id_vp8,
- /* room for new Video codecs */
+ /* room for new Video codecs */
- tdav_codec_id_t140 = tmedia_codec_id_t140,
- tdav_codec_id_red = tmedia_codec_id_red,
+ tdav_codec_id_t140 = tmedia_codec_id_t140,
+ tdav_codec_id_red = tmedia_codec_id_red,
}
tdav_codec_id_t;
diff --git a/tinyDAV/include/tinydav/tdav_apple.h b/tinyDAV/include/tinydav/tdav_apple.h
index 00a09d6..7b5fa86 100755
--- a/tinyDAV/include/tinydav/tdav_apple.h
+++ b/tinyDAV/include/tinydav/tdav_apple.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
- *
+ *
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
- *
+ *
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/tdav_session_av.h b/tinyDAV/include/tinydav/tdav_session_av.h
index 3460fbf..86ecd15 100755
--- a/tinyDAV/include/tinydav/tdav_session_av.h
+++ b/tinyDAV/include/tinydav/tdav_session_av.h
@@ -1,19 +1,19 @@
/*
* Copyright (C) 2012-2013 Doubango Telecom <http://www.doubango.org>
* Copyright (C) 2012 Diop Mamadou Ibrahima
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,26 +38,26 @@ TDAV_BEGIN_DECLS
#define TDAV_SESSION_AV(self) ((tdav_session_av_t*)(self))
-typedef struct tdav_session_av_s
-{
- TMEDIA_DECLARE_SESSION;
-
- tsk_bool_t use_ipv6;
- tsk_bool_t use_rtcp;
- tsk_bool_t use_rtcpmux;
- enum tmedia_type_e media_type;
- enum tmedia_profile_e media_profile;
- enum tmedia_mode_e avpf_mode_set;
- enum tmedia_mode_e avpf_mode_neg;
- tsk_bool_t is_fb_fir_neg; // a=rtcp-fb:* ccm fir
- tsk_bool_t is_fb_nack_neg; // a=rtcp-fb:* nack
- tsk_bool_t is_fb_googremb_neg; // a=rtcp-fb:* goog-remb
- tsk_bool_t use_srtp;
- tsk_bool_t is_webrtc2sip_mode_enabled;
- uint32_t rtp_ssrc;
-
- tmedia_srtp_type_t srtp_type;
- tmedia_srtp_mode_t srtp_mode;
+typedef struct tdav_session_av_s {
+ TMEDIA_DECLARE_SESSION;
+
+ tsk_bool_t use_ipv6;
+ tsk_bool_t use_rtcp;
+ tsk_bool_t use_rtcpmux;
+ enum tmedia_type_e media_type;
+ enum tmedia_profile_e media_profile;
+ enum tmedia_mode_e avpf_mode_set;
+ enum tmedia_mode_e avpf_mode_neg;
+ tsk_bool_t is_fb_fir_neg; // a=rtcp-fb:* ccm fir
+ tsk_bool_t is_fb_nack_neg; // a=rtcp-fb:* nack
+ tsk_bool_t is_fb_googremb_neg; // a=rtcp-fb:* goog-remb
+ tsk_bool_t is_fb_doubsjcng_neg; // a=rtcp-fb:* doubs-jcng
+ tsk_bool_t use_srtp;
+ tsk_bool_t is_webrtc2sip_mode_enabled;
+ uint32_t rtp_ssrc;
+
+ tmedia_srtp_type_t srtp_type;
+ tmedia_srtp_mode_t srtp_mode;
struct {
uint64_t count_last_time;
uint64_t count;
@@ -67,67 +67,67 @@ typedef struct tdav_session_av_s
uint64_t count;
} bytes_out;
uint64_t time_last_frame_loss_report; // from jb
- int32_t bandwidth_max_upload_kbps;
- int32_t bandwidth_max_download_kbps;
- int32_t fps;
- tsk_bool_t congestion_ctrl_enabled;
- tmedia_pref_video_size_t pref_size; // output
-
- /* sdp capabilities (RFC 5939) */
- struct tdav_sdp_caps_s* sdp_caps;
-
- /* NAT Traversal context */
- struct tnet_nat_ctx_s* natt_ctx;
- struct tnet_ice_ctx_s* ice_ctx;
-
- char* local_ip;
- char* remote_ip;
- uint16_t remote_port;
- struct tsdp_message_s* remote_sdp;
- struct tsdp_message_s* local_sdp;
-
- struct trtp_manager_s* rtp_manager;
-
- struct tmedia_consumer_s* consumer;
- struct tmedia_producer_s* producer;
-
- struct{
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new; // "new | existing"
- } local;
- struct{
- tnet_dtls_setup_t setup;
- tsk_bool_t connection_new; // "new | existing"
- } remote;
- } dtls;
-
- struct{
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- uint16_t seq_num;
- uint32_t timestamp;
- } ulpfec;
-
- struct{
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- } red;
-
- struct{
- char* reason;
- tsk_bool_t is_fatal;
- void* tid[1];
- } last_error;
-
- // codec's payload type mapping used when bypassing is enabled
- struct{
- int8_t local;
- int8_t remote;
- int8_t neg;
- } pt_map;
-
- TSK_DECLARE_SAFEOBJ;
+ int32_t bandwidth_max_upload_kbps;
+ int32_t bandwidth_max_download_kbps;
+ int32_t fps;
+ tsk_bool_t congestion_ctrl_enabled;
+ tmedia_pref_video_size_t pref_size; // output
+
+ /* sdp capabilities (RFC 5939) */
+ struct tdav_sdp_caps_s* sdp_caps;
+
+ /* NAT Traversal context */
+ struct tnet_nat_ctx_s* natt_ctx;
+ struct tnet_ice_ctx_s* ice_ctx;
+
+ char* local_ip;
+ char* remote_ip;
+ uint16_t remote_port;
+ struct tsdp_message_s* remote_sdp;
+ struct tsdp_message_s* local_sdp;
+
+ struct trtp_manager_s* rtp_manager;
+
+ struct tmedia_consumer_s* consumer;
+ struct tmedia_producer_s* producer;
+
+ struct {
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new; // "new | existing"
+ } local;
+ struct {
+ tnet_dtls_setup_t setup;
+ tsk_bool_t connection_new; // "new | existing"
+ } remote;
+ } dtls;
+
+ struct {
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ uint16_t seq_num;
+ uint32_t timestamp;
+ } ulpfec;
+
+ struct {
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ } red;
+
+ struct {
+ char* reason;
+ tsk_bool_t is_fatal;
+ void* tid[1];
+ } last_error;
+
+ // codec's payload type mapping used when bypassing is enabled
+ struct {
+ int8_t local;
+ int8_t remote;
+ int8_t neg;
+ } pt_map;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_session_av_t;
diff --git a/tinyDAV/include/tinydav/tdav_win32.h b/tinyDAV/include/tinydav/tdav_win32.h
index cd31fe6..f4443d0 100755
--- a/tinyDAV/include/tinydav/tdav_win32.h
+++ b/tinyDAV/include/tinydav/tdav_win32.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h b/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
index 5609e9d..15b42b1 100755
--- a/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
+++ b/tinyDAV/include/tinydav/video/gdi/tdav_consumer_video_gdi.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h b/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
index f50901e..4c014b9 100755
--- a/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
+++ b/tinyDAV/include/tinydav/video/gdi/tdav_producer_screencast_gdi.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014-2015 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h b/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
index 798f848..691f90a 100755
--- a/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
+++ b/tinyDAV/include/tinydav/video/jb/tdav_video_frame.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -42,17 +42,16 @@ TDAV_BEGIN_DECLS
typedef uint16_t tdav_video_frame_seq_nums[16];
typedef tsk_list_t tdav_video_frames_L_t;
-typedef struct tdav_video_frame_s
-{
- TSK_DECLARE_OBJECT;
+typedef struct tdav_video_frame_s {
+ TSK_DECLARE_OBJECT;
+
+ uint8_t payload_type;
+ uint32_t timestamp;
+ uint16_t highest_seq_num;
+ uint32_t ssrc;
+ trtp_rtp_packets_L_t* pkts;
- uint8_t payload_type;
- uint32_t timestamp;
- uint16_t highest_seq_num;
- uint32_t ssrc;
- trtp_rtp_packets_L_t* pkts;
-
- TSK_DECLARE_SAFEOBJ;
+ TSK_DECLARE_SAFEOBJ;
}
tdav_video_frame_t;
diff --git a/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h b/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
index e47e18b..f4f2a5c 100755
--- a/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
+++ b/tinyDAV/include/tinydav/video/jb/tdav_video_jb.h
@@ -2,19 +2,19 @@
* Copyright (C) 2012 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -39,38 +39,36 @@
TDAV_BEGIN_DECLS
-typedef enum tdav_video_jb_cb_data_type_e
-{
- tdav_video_jb_cb_data_type_rtp,
- tdav_video_jb_cb_data_type_fl, // frame lost
- tdav_video_jb_cb_data_type_tmfr, // too many frames removed
- tdav_video_jb_cb_data_type_fdd, // average frame decoding duration
- tdav_video_jb_cb_data_type_fps_changed, // fps changed, detection done using the timestamp
+typedef enum tdav_video_jb_cb_data_type_e {
+ tdav_video_jb_cb_data_type_rtp,
+ tdav_video_jb_cb_data_type_fl, // frame lost
+ tdav_video_jb_cb_data_type_tmfr, // too many frames removed
+ tdav_video_jb_cb_data_type_fdd, // average frame decoding duration
+ tdav_video_jb_cb_data_type_fps_changed, // fps changed, detection done using the timestamp
}
tdav_video_jb_cb_data_type_t;
-typedef struct tdav_video_jb_cb_data_xs
-{
- tdav_video_jb_cb_data_type_t type;
- uint32_t ssrc;
- const void* usr_data;
- union{
- struct{
- const struct trtp_rtp_packet_s* pkt;
- }rtp;
- struct{
- uint16_t seq_num;
- tsk_size_t count;
- }fl;
- struct{
- uint32_t x_dur; // expected duration in milliseconds
- uint32_t a_dur; // actual duration in milliseconds
- }fdd;
- struct{
- uint32_t old;
- uint32_t new;
- }fps;
- };
+typedef struct tdav_video_jb_cb_data_xs {
+ tdav_video_jb_cb_data_type_t type;
+ uint32_t ssrc;
+ const void* usr_data;
+ union {
+ struct {
+ const struct trtp_rtp_packet_s* pkt;
+ } rtp;
+ struct {
+ uint16_t seq_num;
+ tsk_size_t count;
+ } fl;
+ struct {
+ uint32_t x_dur; // expected duration in milliseconds
+ uint32_t a_dur; // actual duration in milliseconds
+ } fdd;
+ struct {
+ uint32_t old;
+ uint32_t new;
+ } fps;
+ };
}
tdav_video_jb_cb_data_xt;
@@ -79,6 +77,7 @@ typedef int (*tdav_video_jb_cb_f)(const tdav_video_jb_cb_data_xt* data);
struct tdav_video_jb_s* tdav_video_jb_create();
int tdav_video_jb_set_callback(struct tdav_video_jb_s* self, tdav_video_jb_cb_f callback, const void* usr_data);
+int tdav_video_jb_get_qcong(struct tdav_video_jb_s* self, float* q);
int tdav_video_jb_start(struct tdav_video_jb_s* self);
int tdav_video_jb_put(struct tdav_video_jb_s* self, struct trtp_rtp_packet_s* rtp_pkt);
int tdav_video_jb_stop(struct tdav_video_jb_s* self);
diff --git a/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h b/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
index 277c1cc..57f8ce3 100755
--- a/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
+++ b/tinyDAV/include/tinydav/video/mf/tdav_consumer_video_mf.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h b/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
index d1ee296..839fa35 100755
--- a/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
+++ b/tinyDAV/include/tinydav/video/mf/tdav_producer_video_mf.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/tdav_consumer_video.h b/tinyDAV/include/tinydav/video/tdav_consumer_video.h
index a2bb966..3901967 100755
--- a/tinyDAV/include/tinydav/video/tdav_consumer_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_consumer_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2011 Doubango Telecom <http://www.doubango.org>
*
* Contact: Mamadou Diop <diopmamadou(at)doubango(DOT)org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -38,13 +38,12 @@ TDAV_BEGIN_DECLS
#define TDAV_CONSUMER_VIDEO(self) ((tdav_consumer_video_t*)(self))
-typedef struct tdav_consumer_video_s
-{
- TMEDIA_DECLARE_CONSUMER;
-
- struct tmedia_jitterbuffer_s* jitterbuffer;
-
- TSK_DECLARE_SAFEOBJ;
+typedef struct tdav_consumer_video_s {
+ TMEDIA_DECLARE_CONSUMER;
+
+ struct tmedia_jitterbuffer_s* jitterbuffer;
+
+ TSK_DECLARE_SAFEOBJ;
}
tdav_consumer_video_t;
diff --git a/tinyDAV/include/tinydav/video/tdav_converter_video.h b/tinyDAV/include/tinydav/video/tdav_converter_video.h
index 2ab3144..a721467 100755
--- a/tinyDAV/include/tinydav/video/tdav_converter_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_converter_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
diff --git a/tinyDAV/include/tinydav/video/tdav_runnable_video.h b/tinyDAV/include/tinydav/video/tdav_runnable_video.h
index 4c8aef1..44204d0 100755
--- a/tinyDAV/include/tinydav/video/tdav_runnable_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_runnable_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -35,11 +35,10 @@
TDAV_BEGIN_DECLS
-typedef struct tdav_runnable_video_s
-{
- TSK_DECLARE_RUNNABLE;
+typedef struct tdav_runnable_video_s {
+ TSK_DECLARE_RUNNABLE;
- const void* userdata;
+ const void* userdata;
}
tdav_runnable_video_t;
diff --git a/tinyDAV/include/tinydav/video/tdav_session_video.h b/tinyDAV/include/tinydav/video/tdav_session_video.h
index a1cb7d4..54cea1f 100755
--- a/tinyDAV/include/tinydav/video/tdav_session_video.h
+++ b/tinyDAV/include/tinydav/video/tdav_session_video.h
@@ -2,19 +2,19 @@
* Copyright (C) 2010-2011 Mamadou Diop.
*
* Contact: Mamadou Diop <diopmamadou(at)doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*
@@ -32,91 +32,100 @@
#include "tinydav_config.h"
#include "tinydav/tdav_session_av.h"
+#include "tsk_timer.h"
TDAV_BEGIN_DECLS
-typedef enum tdav_session_video_pkt_loss_level_e
-{
- tdav_session_video_pkt_loss_level_low,
- tdav_session_video_pkt_loss_level_medium,
- tdav_session_video_pkt_loss_level_high,
+typedef enum tdav_session_video_pkt_loss_level_e {
+ tdav_session_video_pkt_loss_level_low,
+ tdav_session_video_pkt_loss_level_medium,
+ tdav_session_video_pkt_loss_level_high,
}
tdav_session_video_pkt_loss_level_t;
-typedef struct tdav_session_video_s
-{
- TDAV_DECLARE_SESSION_AV;
+typedef struct tdav_session_video_s {
+ TDAV_DECLARE_SESSION_AV;
+
+ struct tdav_video_jb_s* jb;
+ tsk_bool_t jb_enabled;
+ tsk_bool_t zero_artifacts;
+ tsk_bool_t fps_changed;
+ tsk_bool_t started;
- struct tdav_video_jb_s* jb;
- tsk_bool_t jb_enabled;
- tsk_bool_t zero_artifacts;
- tsk_bool_t fps_changed;
- tsk_bool_t started;
+ struct {
+ tsk_timer_manager_handle_t* mgr;
+ tsk_timer_id_t id_qos;
+ } timer;
- struct{
- const void* context;
- tmedia_session_rtcp_onevent_cb_f func;
- } cb_rtcpevent;
+ struct {
+ const void* context;
+ tmedia_session_rtcp_onevent_cb_f func;
+ } cb_rtcpevent;
- struct{
- void* buffer;
- tsk_size_t buffer_size;
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
- int rotation;
+ int rotation;
tsk_bool_t scale_rotated_frames;
- void* conv_buffer;
- tsk_size_t conv_buffer_size;
-
- tdav_session_video_pkt_loss_level_t pkt_loss_level;
- int32_t pkt_loss_fact;
- int32_t pkt_loss_prob_good;
- int32_t pkt_loss_prob_bad;
-
- uint64_t last_frame_time;
-
- uint8_t payload_type;
- struct tmedia_codec_s* codec;
- tsk_mutex_handle_t* h_mutex;
- } encoder;
-
- struct{
- void* buffer;
- tsk_size_t buffer_size;
-
- void* conv_buffer;
- tsk_size_t conv_buffer_size;
-
- // latest decoded RTP seqnum
- uint16_t last_seqnum;
- // stream is corrupted if packets are lost
- tsk_bool_t stream_corrupted;
- uint64_t stream_corrupted_since;
- uint32_t last_corrupted_timestamp;
-
- uint8_t codec_payload_type;
- struct tmedia_codec_s* codec;
- uint64_t codec_decoded_frames_count;
- } decoder;
-
- struct {
- tsk_size_t consumerLastWidth;
- tsk_size_t consumerLastHeight;
- struct tmedia_converter_video_s* fromYUV420;
-
- tsk_size_t producerWidth;
- tsk_size_t producerHeight;
- tsk_size_t xProducerSize;
- struct tmedia_converter_video_s* toYUV420;
- } conv;
-
- struct{
- tsk_list_t* packets;
- tsk_size_t count;
- tsk_size_t max;
- uint64_t last_fir_time;
- uint64_t last_pli_time;
- } avpf;
+ void* conv_buffer;
+ tsk_size_t conv_buffer_size;
+
+ uint64_t last_frame_time;
+
+ uint8_t payload_type;
+ struct tmedia_codec_s* codec;
+ tsk_mutex_handle_t* h_mutex;
+ } encoder;
+
+ struct {
+ void* buffer;
+ tsk_size_t buffer_size;
+
+ void* conv_buffer;
+ tsk_size_t conv_buffer_size;
+
+ // latest decoded RTP seqnum
+ uint16_t last_seqnum;
+ // stream is corrupted if packets are lost
+ tsk_bool_t stream_corrupted;
+ uint64_t stream_corrupted_since;
+ uint32_t last_corrupted_timestamp;
+
+ uint8_t codec_payload_type;
+ struct tmedia_codec_s* codec;
+ uint64_t codec_decoded_frames_count;
+ } decoder;
+
+ struct {
+ tsk_size_t consumerLastWidth;
+ tsk_size_t consumerLastHeight;
+ struct tmedia_converter_video_s* fromYUV420;
+
+ tsk_size_t producerWidth;
+ tsk_size_t producerHeight;
+ tsk_size_t xProducerSize;
+ struct tmedia_converter_video_s* toYUV420;
+ } conv;
+
+ struct {
+ tsk_list_t* packets;
+ tsk_size_t count;
+ tsk_size_t max;
+ uint64_t last_fir_time;
+ uint64_t last_pli_time;
+ } avpf;
+
+ unsigned q1_n;
+ unsigned q2_n;
+ unsigned q3_n;
+ unsigned q4_n;
+ unsigned q5_n;
+ unsigned in_avg_fps_n;
+ unsigned dec_avg_time_n;
+ unsigned enc_avg_time_n;
+ tsk_mutex_handle_t* h_mutex_qos;
}
tdav_session_video_t;
diff --git a/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h b/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
index 496bfcb..a0fe2ea 100755
--- a/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
+++ b/tinyDAV/include/tinydav/video/v4linux/tdav_producer_video_v4l2.h
@@ -1,17 +1,17 @@
/* Copyright (C) 2014 Mamadou DIOP.
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h b/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
index 3bdd52c..ba41541 100755
--- a/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
+++ b/tinyDAV/include/tinydav/video/winm/tdav_consumer_winm.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
diff --git a/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h b/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
index 34d4254..c9b21e4 100755
--- a/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
+++ b/tinyDAV/include/tinydav/video/winm/tdav_producer_winm.h
@@ -1,17 +1,17 @@
/*Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
-*
+*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO 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 3 of the License, or
* (at your option) any later version.
-*
+*
* DOUBANGO 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 DOUBANGO.
*/
OpenPOWER on IntegriCloud