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 H261PACKET_H
00025
#define H261PACKET_H
00026
00027
#include "PlainPacket.h"
00028
00029
00030
00031
00032
00033 class H261Packet
00034 {
00035
PlainPacket* _packet;
00036
00037
struct Preview
00038 {
00039
unsigned char* _buf;
00040
unsigned int _size;
00041
00042
unsigned int _ctr;
00043
unsigned int _discard_head;
00044
unsigned int _discard_tail;
00045
bool _is_picture;
00046
unsigned int _tempref;
00047
unsigned int _gob_number;
00048
00049 Preview( );
00050 ~Preview( );
00051
00052
void adapt(
unsigned int max );
00053 };
00054
00055 Preview _preview;
00056
unsigned int _last_temp_ref;
00057
bool _initialized;
00058
00059
void initRTPHeader(
unsigned char* buffer,
00060
unsigned int discard_head,
00061
unsigned int discard_tail,
00062
unsigned int gob_number );
00063
00064
int getGOB( Preview& preview );
00065
00066
int getGOB(
unsigned char* dest,
00067
unsigned int& max,
00068
unsigned int& discard_head,
00069
unsigned int& discard_tail,
00070
bool& is_picture,
00071
unsigned int& temporal_reference,
00072
unsigned int& gob_number );
00073
00074
public:
00075
00076
H261Packet(
PlainPacket* packet );
00077
00078
int getRTPPacket(
unsigned char* dest,
00079 size_t& max,
00080
unsigned int& temporal_reference,
00081
bool& marker );
00082
00083
int getPacket(
unsigned char* dest,
00084
unsigned int& max,
00085
unsigned int& discard_head,
00086
unsigned int& discard_tail,
00087
unsigned int& temporal_reference,
00088
unsigned int& gob_number,
00089
bool& marker );
00090
00091 };
00092
00093
00094
00095
00096
00097 class H261FilePacket
00098 :
public PlainFilePacket
00099 ,
public H261Packet
00100 {
00101
public:
00102
00103
H261FilePacket(
int fd );
00104
00105 };
00106
00107
00108
00109
00110
00111 class H261RopePacket
00112 :
public PlainRopePacket
00113 ,
public H261Packet
00114 {
00115
public:
00116
00117
H261RopePacket(
SH::SinkEndpoint* pull_here );
00118
00119
MNRope*
getRTPPacket(
SH::SinkEndpoint* pull_here,
00120 size_t max_bytes_to_pull,
00121
unsigned int& temporal_reference,
00122
bool& mark );
00123 };
00124
00125
#endif
00126