2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_VIDEO_CODING_RECEIVER_H_
|
|
|
|
|
#define MODULES_VIDEO_CODING_RECEIVER_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-02-29 05:51:59 -08:00
|
|
|
#include <memory>
|
2015-12-21 04:12:39 -08:00
|
|
|
#include <vector>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/video_coding/include/video_coding.h"
|
|
|
|
|
#include "modules/video_coding/include/video_coding_defines.h"
|
|
|
|
|
#include "modules/video_coding/jitter_buffer.h"
|
|
|
|
|
#include "modules/video_coding/packet.h"
|
|
|
|
|
#include "modules/video_coding/timing.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "rtc_base/critical_section.h"
|
2018-12-04 13:15:37 +01:00
|
|
|
#include "system_wrappers/include/event_wrapper.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-01-07 08:49:41 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-01-21 07:42:11 +00:00
|
|
|
class Clock;
|
2011-07-07 08:21:25 +00:00
|
|
|
class VCMEncodedFrame;
|
|
|
|
|
|
2013-01-07 08:49:41 +00:00
|
|
|
class VCMReceiver {
|
|
|
|
|
public:
|
2018-11-07 16:36:22 +01:00
|
|
|
VCMReceiver(VCMTiming* timing, Clock* clock);
|
2015-06-19 09:17:00 -07:00
|
|
|
|
2018-11-07 16:36:22 +01:00
|
|
|
// Using this constructor, you can specify a different event implemetation for
|
|
|
|
|
// the jitter buffer. Useful for unit tests when you want to simulate incoming
|
2015-06-19 09:17:00 -07:00
|
|
|
// packets, in which case the jitter buffer's wait event is different from
|
|
|
|
|
// that of VCMReceiver itself.
|
|
|
|
|
VCMReceiver(VCMTiming* timing,
|
|
|
|
|
Clock* clock,
|
2016-02-29 05:51:59 -08:00
|
|
|
std::unique_ptr<EventWrapper> receiver_event,
|
|
|
|
|
std::unique_ptr<EventWrapper> jitter_buffer_event);
|
2015-06-19 09:17:00 -07:00
|
|
|
|
2013-01-07 08:49:41 +00:00
|
|
|
~VCMReceiver();
|
|
|
|
|
|
2016-06-28 11:11:28 +02:00
|
|
|
int32_t InsertPacket(const VCMPacket& packet);
|
2013-01-07 08:49:41 +00:00
|
|
|
VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms,
|
2015-12-10 09:27:38 -08:00
|
|
|
bool prefer_late_decoding);
|
2013-01-07 08:49:41 +00:00
|
|
|
void ReleaseFrame(VCMEncodedFrame* frame);
|
|
|
|
|
|
|
|
|
|
// NACK.
|
2013-02-01 15:09:57 +00:00
|
|
|
void SetNackSettings(size_t max_nack_list_size,
|
2013-05-07 19:16:33 +00:00
|
|
|
int max_packet_age_to_nack,
|
|
|
|
|
int max_incomplete_time_ms);
|
2015-06-03 15:03:35 -07:00
|
|
|
std::vector<uint16_t> NackList(bool* request_key_frame);
|
2013-01-07 08:49:41 +00:00
|
|
|
|
|
|
|
|
private:
|
2015-02-17 13:22:43 +00:00
|
|
|
Clock* const clock_;
|
2013-01-07 08:49:41 +00:00
|
|
|
VCMJitterBuffer jitter_buffer_;
|
|
|
|
|
VCMTiming* timing_;
|
2016-02-29 05:51:59 -08:00
|
|
|
std::unique_ptr<EventWrapper> render_wait_event_;
|
2013-02-15 23:22:18 +00:00
|
|
|
int max_video_delay_ms_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-01-07 08:49:41 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_VIDEO_CODING_RECEIVER_H_
|