⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 packet_data_agent.h

📁 各种视频压缩格式的网络传输的模拟信道分析
💻 H
字号:
/*
 ==========================================================================================
 ITU-T Telecommunications Standardization Sector      Document:   VCEG-M77
 Study Group 16 Question 6                            Filename:   packet_data_agent.h
 Video Coding Experts Group (VCEG)                    Generated:  29 June, 2001
 ----------------------------------------
 Thirteenth meeting: Austin, Texas, 2-4 April, 2001


 Intention: 
 ~~~~~~~~~~~~
 Simple offline software simulator for RTP/IP over 3GPP/3GPP2 bearers


 Source:
 ~~~~~~~
 Thomas Stockhammer, Guenther Liebl                  Tel:   +49 89 28923473
 Institute for Communications Engineering            Fax:   +49 89 28923490
 Munich University of Technology                     Email: {stockhammer,liebl}@ei.tum.de
 80290 Munich, Germany
 ==========================================================================================
*/


#ifndef PACKET_DATA_AGENT_H
#define PACKET_DATA_AGENT_H


#include "global.h"


// size of the data buffer
#define PACKET_BUFFER_SIZE 20


// minimal RTP header size (in bytes)
#define MIN_RTP_HEADER_SIZE 12


// storage type for RTP packets that are read or written to file
typedef struct rtp_packet
{
  int32 size;
  int32 timestamp;
  byte *data;
} RTP_PACKET;



// simulator-internal storage type for packet data agent PDUs
typedef struct virtual_pdu
{
  int32 internal_identifier;
  int32 size;
} VIRTUAL_PDU;



class PACKET_DATA_AGENT
{
 public:
  PACKET_DATA_AGENT();
  ~PACKET_DATA_AGENT();
  void initialize(FILE *ParameterFile_ptr, FILE *CommonLogFile_ptr);
  int32 get_PDU(int32 current_time, VIRTUAL_PDU *PDU_in);
  void put_PDU(int32 current_time, VIRTUAL_PDU *PDU_out);
  void discard_PDU(int32 current_time, VIRTUAL_PDU *PDU_out);
  void write_statistics(FILE *StatisticsFile_ptr); 

 private:
  int32 compress_Internet_header(RTP_PACKET *Uncompressed_RTP_Packet);

  char *ModuleName;

  FILE *LogFile_ptr;

  char InputFile[100], OutputFile[100];
  FILE *InputFile_ptr, *OutputFile_ptr;

  int32 agent_header_size;
  int32 compressed_Internet_header_size;

  RTP_PACKET RTP_Buffer[PACKET_BUFFER_SIZE];
  int32 RTP_buffer_read_position;
  int32 RTP_buffer_write_position;
  int32 RTP_buffer_length;

  int32 total_packets_counter;
  int32 total_lost_packets_counter;
  double packet_loss_rate;
  int32 total_correct_bits_counter;
  int32 total_correct_payload_bits_counter;
  double effective_bitrate;
  double effective_net_bitrate;

  int32 simulation_time;
};


#endif // PACKET_DATA_AGENT_H


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -