tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

receiver.h (2275B)


      1 /*
      2 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
      3 *
      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
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 #ifndef MODULES_VIDEO_CODING_DEPRECATED_RECEIVER_H_
     12 #define MODULES_VIDEO_CODING_DEPRECATED_RECEIVER_H_
     13 
     14 #include <cstddef>
     15 #include <cstdint>
     16 #include <memory>
     17 #include <vector>
     18 
     19 #include "api/field_trials_view.h"
     20 #include "modules/video_coding/deprecated/event_wrapper.h"
     21 #include "modules/video_coding/deprecated/jitter_buffer.h"
     22 #include "modules/video_coding/deprecated/packet.h"
     23 #include "modules/video_coding/timing/timing.h"
     24 
     25 namespace webrtc {
     26 
     27 class Clock;
     28 class VCMEncodedFrame;
     29 
     30 class VCMReceiver {
     31 public:
     32  VCMReceiver(VCMTiming* timing,
     33              Clock* clock,
     34              const FieldTrialsView& field_trials);
     35 
     36  // Using this constructor, you can specify a different event implemetation for
     37  // the jitter buffer. Useful for unit tests when you want to simulate incoming
     38  // packets, in which case the jitter buffer's wait event is different from
     39  // that of VCMReceiver itself.
     40  VCMReceiver(VCMTiming* timing,
     41              Clock* clock,
     42              std::unique_ptr<EventWrapper> receiver_event,
     43              std::unique_ptr<EventWrapper> jitter_buffer_event,
     44              const FieldTrialsView& field_trials);
     45 
     46  ~VCMReceiver();
     47 
     48  int32_t InsertPacket(const VCMPacket& packet);
     49  VCMEncodedFrame* FrameForDecoding(uint16_t max_wait_time_ms,
     50                                    bool prefer_late_decoding);
     51  void ReleaseFrame(VCMEncodedFrame* frame);
     52 
     53  // NACK.
     54  void SetNackSettings(size_t max_nack_list_size,
     55                       int max_packet_age_to_nack,
     56                       int max_incomplete_time_ms);
     57  std::vector<uint16_t> NackList(bool* request_key_frame);
     58 
     59 private:
     60  Clock* const clock_;
     61  VCMJitterBuffer jitter_buffer_;
     62  VCMTiming* timing_;
     63  std::unique_ptr<EventWrapper> render_wait_event_;
     64  int max_video_delay_ms_;
     65 };
     66 
     67 }  // namespace webrtc
     68 
     69 #endif  // MODULES_VIDEO_CODING_DEPRECATED_RECEIVER_H_