diff options
Diffstat (limited to 'tinyDAV/include/tinydav/video')
13 files changed, 167 insertions, 162 deletions
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. */ |