OLD | NEW |
---|---|
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 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 VCMFrameBuffer* PopFrame(uint32_t timestamp); | 67 VCMFrameBuffer* PopFrame(uint32_t timestamp); |
68 VCMFrameBuffer* Front() const; | 68 VCMFrameBuffer* Front() const; |
69 VCMFrameBuffer* Back() const; | 69 VCMFrameBuffer* Back() const; |
70 int RecycleFramesUntilKeyFrame(FrameList::iterator* key_frame_it, | 70 int RecycleFramesUntilKeyFrame(FrameList::iterator* key_frame_it, |
71 UnorderedFrameList* free_frames); | 71 UnorderedFrameList* free_frames); |
72 void CleanUpOldOrEmptyFrames(VCMDecodingState* decoding_state, | 72 void CleanUpOldOrEmptyFrames(VCMDecodingState* decoding_state, |
73 UnorderedFrameList* free_frames); | 73 UnorderedFrameList* free_frames); |
74 void Reset(UnorderedFrameList* free_frames); | 74 void Reset(UnorderedFrameList* free_frames); |
75 }; | 75 }; |
76 | 76 |
77 class Vp9SsMap { | |
78 public: | |
79 Vp9SsMap() {} | |
80 ~Vp9SsMap() {} | |
stefan-webrtc
2015/10/13 13:49:43
No need for these constructors, right?
åsapersson
2015/10/14 15:13:51
Done.
| |
81 | |
82 bool Insert(const VCMPacket& packet); | |
83 void Reset(); | |
84 | |
85 // Removes SS data that are older than |timestamp|. | |
86 void RemoveOld(uint32_t timestamp); | |
87 | |
88 bool UpdatePacket(const VCMPacket* packet); | |
89 void UpdateFrames(FrameList* frames); | |
90 | |
91 // Public for testing. | |
92 // Finds the corresponding |ss_timestamp| for the input |timestamp|. | |
93 bool Find(uint32_t timestamp, uint32_t* ss_timestamp) const; | |
stefan-webrtc
2015/10/13 13:49:43
Not a big fan of this type of testing. Isn't it po
| |
94 | |
95 private: | |
96 bool TimeForPeriodicUpdate(uint32_t timestamp) const; | |
97 void RemoveOlderThan(uint32_t timestamp); | |
98 void AdvanceFront(uint32_t timestamp); | |
99 | |
100 std::map<uint32_t, GofInfoVP9, TimestampLessThan> ss_map_; | |
101 }; | |
102 | |
77 class VCMJitterBuffer { | 103 class VCMJitterBuffer { |
78 public: | 104 public: |
79 VCMJitterBuffer(Clock* clock, rtc::scoped_ptr<EventWrapper> event); | 105 VCMJitterBuffer(Clock* clock, rtc::scoped_ptr<EventWrapper> event); |
80 | 106 |
81 ~VCMJitterBuffer(); | 107 ~VCMJitterBuffer(); |
82 | 108 |
83 // Initializes and starts jitter buffer. | 109 // Initializes and starts jitter buffer. |
84 void Start(); | 110 void Start(); |
85 | 111 |
86 // Signals all internal events and stops the jitter buffer. | 112 // Signals all internal events and stops the jitter buffer. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 // Event to signal when we have a frame ready for decoder. | 327 // Event to signal when we have a frame ready for decoder. |
302 rtc::scoped_ptr<EventWrapper> frame_event_; | 328 rtc::scoped_ptr<EventWrapper> frame_event_; |
303 // Number of allocated frames. | 329 // Number of allocated frames. |
304 int max_number_of_frames_; | 330 int max_number_of_frames_; |
305 UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); | 331 UnorderedFrameList free_frames_ GUARDED_BY(crit_sect_); |
306 FrameList decodable_frames_ GUARDED_BY(crit_sect_); | 332 FrameList decodable_frames_ GUARDED_BY(crit_sect_); |
307 FrameList incomplete_frames_ GUARDED_BY(crit_sect_); | 333 FrameList incomplete_frames_ GUARDED_BY(crit_sect_); |
308 VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); | 334 VCMDecodingState last_decoded_state_ GUARDED_BY(crit_sect_); |
309 bool first_packet_since_reset_; | 335 bool first_packet_since_reset_; |
310 // Contains last received frame's temporal information for non-flexible mode. | 336 // Contains last received frame's temporal information for non-flexible mode. |
311 GofInfoVP9 last_gof_; | 337 Vp9SsMap vp9_ss_map_; // GUARDED_BY(crit_sect_) |
312 uint32_t last_gof_timestamp_; | |
313 bool last_gof_valid_; | |
314 | 338 |
315 // Statistics. | 339 // Statistics. |
316 VCMReceiveStatisticsCallback* stats_callback_ GUARDED_BY(crit_sect_); | 340 VCMReceiveStatisticsCallback* stats_callback_ GUARDED_BY(crit_sect_); |
317 // Frame counts for each type (key, delta, ...) | 341 // Frame counts for each type (key, delta, ...) |
318 FrameCounts receive_statistics_; | 342 FrameCounts receive_statistics_; |
319 // Latest calculated frame rates of incoming stream. | 343 // Latest calculated frame rates of incoming stream. |
320 unsigned int incoming_frame_rate_; | 344 unsigned int incoming_frame_rate_; |
321 unsigned int incoming_frame_count_; | 345 unsigned int incoming_frame_count_; |
322 int64_t time_last_incoming_frame_count_; | 346 int64_t time_last_incoming_frame_count_; |
323 unsigned int incoming_bit_count_; | 347 unsigned int incoming_bit_count_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
358 // Estimated rolling average of packets per frame | 382 // Estimated rolling average of packets per frame |
359 float average_packets_per_frame_; | 383 float average_packets_per_frame_; |
360 // average_packets_per_frame converges fast if we have fewer than this many | 384 // average_packets_per_frame converges fast if we have fewer than this many |
361 // frames. | 385 // frames. |
362 int frame_counter_; | 386 int frame_counter_; |
363 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); | 387 RTC_DISALLOW_COPY_AND_ASSIGN(VCMJitterBuffer); |
364 }; | 388 }; |
365 } // namespace webrtc | 389 } // namespace webrtc |
366 | 390 |
367 #endif // WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_JITTER_BUFFER_H_ | 391 #endif // WEBRTC_MODULES_VIDEO_CODING_MAIN_SOURCE_JITTER_BUFFER_H_ |
OLD | NEW |