Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: webrtc/modules/video_coding/jitter_buffer.h

Issue 1778503002: Experiment for the nack module. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_
12 #define WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ 12 #define WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_
13 13
14 #include <list> 14 #include <list>
15 #include <map> 15 #include <map>
16 #include <memory> 16 #include <memory>
17 #include <set> 17 #include <set>
18 #include <vector> 18 #include <vector>
19 19
20 #include "webrtc/base/constructormagic.h" 20 #include "webrtc/base/constructormagic.h"
21 #include "webrtc/base/thread_annotations.h" 21 #include "webrtc/base/thread_annotations.h"
22 #include "webrtc/modules/include/module_common_types.h" 22 #include "webrtc/modules/include/module_common_types.h"
23 #include "webrtc/modules/utility/include/process_thread.h"
23 #include "webrtc/modules/video_coding/include/video_coding.h" 24 #include "webrtc/modules/video_coding/include/video_coding.h"
24 #include "webrtc/modules/video_coding/include/video_coding_defines.h" 25 #include "webrtc/modules/video_coding/include/video_coding_defines.h"
25 #include "webrtc/modules/video_coding/decoding_state.h" 26 #include "webrtc/modules/video_coding/decoding_state.h"
26 #include "webrtc/modules/video_coding/inter_frame_delay.h" 27 #include "webrtc/modules/video_coding/inter_frame_delay.h"
27 #include "webrtc/modules/video_coding/jitter_buffer_common.h" 28 #include "webrtc/modules/video_coding/jitter_buffer_common.h"
28 #include "webrtc/modules/video_coding/jitter_estimator.h" 29 #include "webrtc/modules/video_coding/jitter_estimator.h"
30 #include "webrtc/modules/video_coding/nack_module.h"
29 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" 31 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
30 #include "webrtc/typedefs.h" 32 #include "webrtc/typedefs.h"
31 33
32 namespace webrtc { 34 namespace webrtc {
33 35
34 enum VCMNackMode { kNack, kNoNack }; 36 enum VCMNackMode { kNack, kNoNack };
35 37
36 // forward declarations 38 // forward declarations
37 class Clock; 39 class Clock;
38 class EventFactory; 40 class EventFactory;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // Advances the oldest SS data to handle timestamp wrap in cases where SS data 99 // Advances the oldest SS data to handle timestamp wrap in cases where SS data
98 // are received very seldom (e.g. only once in beginning, second when 100 // are received very seldom (e.g. only once in beginning, second when
99 // IsNewerTimestamp is not true). 101 // IsNewerTimestamp is not true).
100 void AdvanceFront(uint32_t timestamp); 102 void AdvanceFront(uint32_t timestamp);
101 103
102 SsMap ss_map_; 104 SsMap ss_map_;
103 }; 105 };
104 106
105 class VCMJitterBuffer { 107 class VCMJitterBuffer {
106 public: 108 public:
107 VCMJitterBuffer(Clock* clock, std::unique_ptr<EventWrapper> event); 109 VCMJitterBuffer(Clock* clock,
110 std::unique_ptr<EventWrapper> event,
111 ProcessThread* module_process_thread = nullptr,
112 NackSender* nack_sender = nullptr,
113 KeyFrameRequestSender* keyframe_request_sender = nullptr);
108 114
109 ~VCMJitterBuffer(); 115 ~VCMJitterBuffer();
110 116
111 // Initializes and starts jitter buffer. 117 // Initializes and starts jitter buffer.
112 void Start(); 118 void Start();
113 119
114 // Signals all internal events and stops the jitter buffer. 120 // Signals all internal events and stops the jitter buffer.
115 void Stop(); 121 void Stop();
116 122
117 // Returns true if the jitter buffer is running. 123 // Returns true if the jitter buffer is running.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 size_t max_nack_list_size_; 382 size_t max_nack_list_size_;
377 int max_packet_age_to_nack_; // Measured in sequence numbers. 383 int max_packet_age_to_nack_; // Measured in sequence numbers.
378 int max_incomplete_time_ms_; 384 int max_incomplete_time_ms_;
379 385
380 VCMDecodeErrorMode decode_error_mode_; 386 VCMDecodeErrorMode decode_error_mode_;
381 // Estimated rolling average of packets per frame 387 // Estimated rolling average of packets per frame
382 float average_packets_per_frame_; 388 float average_packets_per_frame_;
383 // average_packets_per_frame converges fast if we have fewer than this many 389 // average_packets_per_frame converges fast if we have fewer than this many
384 // frames. 390 // frames.
385 int frame_counter_; 391 int frame_counter_;
392
393 ProcessThread* module_process_thread_;
394 std::unique_ptr<NackModule> nack_module_;
395
386 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); 396 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer);
387 }; 397 };
388 } // namespace webrtc 398 } // namespace webrtc
389 399
390 #endif // WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_ 400 #endif // WEBRTC_MODULES_VIDEO_CODING_JITTER_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698