00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef MNRTP_ENCODER_BASE_H
00025
#define MNRTP_ENCODER_BASE_H
00026
00027
#include <config.h>
00028
00029
#include "MNRTPutildefs.h"
00030
#include "sh/SHReturnCodes.h"
00031
#include "sdp/PayloadTypes.h"
00032
#include "MNTimeval.h"
00033
00034
class MNRope;
00035
class RetransBase;
00036
00037 namespace SH
00038 {
00039
class SinkEndpoint;
00040
class Data;
00041 };
00042
00043
00044
00045
00046
00047
00048
00049 class MNRTPEncoderBase
00050 {
00051
00052
00053
00054
00060 size_t _std_packet_length;
00061
00065 size_t _cur_packet_length;
00066
00072
Timeval _cur_time_offset;
00073
00077 size_t _cur_rtp_timestamp_offset;
00078
00079
public:
00084 enum timer_type
00085 {
00086
TT_PERIODIC,
00087
TT_DYNAMIC
00088 };
00089
00090
00091
00092 size_t
get_std_packetsize() const;
00093
void set_std_packetsize( size_t sz );
00094 size_t get_packetsize() const;
00095
00096
00097
00098
Timeval get_timeout( ) const;
00099
00100
00101
00102 size_t get_ts_offset() const;
00103
void set_ts_offset( size_t ts );
00104
00105 virtual size_t get_abs_byte_pos() = 0;
00106 virtual
void update_absolute_position(
int32 offset ) = 0;
00107
00108 public:
00111
MNRTPEncoderBase();
00112
00115 virtual ~MNRTPEncoderBase();
00116
00117 public:
00161 virtual
MNRope* get_next_data( SH::SinkEndpoint* pull_here,
00162 size_t max_bytes_to_pull,
00163 SH::ReturnCode& except,
00164 size_t& pulled_bytes,
00165
bool& rtp_marker,
00166
u_int32& rtp_timestamp,
00167
Timeval& next_playtime_packet,
00168
int bandwidth ) = 0;
00169
00170 virtual
MNRope* get_data( SH::SinkEndpoint* pull_here,
00171 size_t max_bytes_to_pull,
00172 SH::ReturnCode& except,
00173 size_t& pulled_bytes,
00174
bool& rtp_marker,
00175
u_int32& rtp_timestamp,
00176
Timeval& next_playtime_packet,
00177
int bandwidth,
00178
u_int32 filepos );
00179
00180
00181 virtual
u_int32_t get_std_bw(
int fd ) = 0;
00182
00186 static MNRTPEncoderBase* factory( SDP::PayloadTypes payload_type,
RetransBase* retrans );
00187
00193 virtual
int get_timer_type( ) = 0;
00194
00198 virtual size_t get_pulled_bytes( ) = 0;
00199 };
00200
00201 #endif