OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

h224.h
Go to the documentation of this file.
1 /*
2 * h224.h
3 *
4 * H.224 PDU implementation for the OpenH323 Project.
5 *
6 * Copyright (c) 2006 Network for Educational Technology, ETH Zurich.
7 * Written by Hannes Friederich.
8 *
9 * The contents of this file are subject to the Mozilla Public License
10 * Version 1.0 (the "License"); you may not use this file except in
11 * compliance with the License. You may obtain a copy of the License at
12 * http://www.mozilla.org/MPL/
13 *
14 * Software distributed under the License is distributed on an "AS IS"
15 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
16 * the License for the specific language governing rights and limitations
17 * under the License.
18 *
19 * Contributor(s): ______________________________________.
20 *
21 * $Revision: 21862 $
22 * $Author: csoutheren $
23 * $Date: 2008-12-22 21:24:53 -0600 (Mon, 22 Dec 2008) $
24 */
25
26 #ifndef OPAL_H224_H224_H
27 #define OPAL_H224_H224_H
28
29 #ifdef P_USE_PRAGMA
30 #pragma interface
31 #endif
32
33 #ifndef _PTLIB_H
34 #include <ptlib.h>
35 #endif
36
37 #include <opal/buildopts.h>
38
39 #include <opal/mediatype.h>
40 #include <opal/mediafmt.h>
41 #include <h224/q922.h>
42
43 #define H224_HEADER_SIZE 6
44
46 //
47 // declare a media type for H.224
48 //
49
50 class OpalH224MediaType : public OpalRTPAVPMediaType
51 {
52 public:
53 OpalH224MediaType();
54
55 static const OpalMediaType & MediaType();
56
57 #if OPAL_SIP
58 SDPMediaDescription * CreateSDPMediaDescription(const OpalTransportAddress & localAddress);
59 #endif
60 };
61
63 //
64 // H.224 Media Format
65 //
66
67 class OpalH224MediaFormat : public OpalMediaFormat
68 {
69 PCLASSINFO(OpalH224MediaFormat, OpalMediaFormat);
70
71 public:
72 OpalH224MediaFormat(
73 const char * fullName,
74 RTP_DataFrame::PayloadTypes rtpPayloadType
75 );
76 virtual PObject * Clone() const;
77 virtual PBoolean IsValidForProtocol(const PString & protocol) const;
78 };
79
80 extern const OpalMediaFormat & GetOpalH224_H323AnnexQ();
81 extern const OpalMediaFormat & GetOpalH224_HDLCTunneling();
82
83
84 #define OpalH224AnnexQ GetOpalH224_H323AnnexQ()
85 #define OpalH224Tunnelled GetOpalH224_HDLCTunneling()
86
88
89 class OpalH224Client;
90
91 class H224_Frame : public Q922_Frame
92 {
93 PCLASSINFO(H224_Frame, Q922_Frame);
94
95 public:
96
97 H224_Frame(PINDEX clientDataSize = 254);
98 H224_Frame(const OpalH224Client & h224Client, PINDEX clientDataSize = 254);
99 ~H224_Frame();
100
101 PBoolean IsHighPriority() const { return (GetLowOrderAddressOctet() == 0x71); }
102 void SetHighPriority(PBoolean flag);
103
104 WORD GetDestinationTerminalAddress() const;
105 void SetDestinationTerminalAddress(WORD destination);
106
107 WORD GetSourceTerminalAddress() const;
108 void SetSourceTerminalAddress(WORD source);
109
111 void SetClient(const OpalH224Client & h224Client);
112
113 BYTE GetClientID() const;
114 void SetClientID(BYTE clientID);
115
117 BYTE GetExtendedClientID() const;
119 void SetExtendedClientID(BYTE extendedClientID);
120
122 BYTE GetCountryCode() const;
123 BYTE GetCountryCodeExtension() const;
124 WORD GetManufacturerCode() const;
125 BYTE GetManufacturerClientID() const;
126
128 void SetNonStandardClientInformation(BYTE countryCode,
129 BYTE countryCodeExtension,
130 WORD manufacturerCode,
131 BYTE manufacturerClientID);
132
135 PBoolean GetBS() const;
136 void SetBS(PBoolean bs);
137
138 PBoolean GetES() const;
139 void SetES(PBoolean es);
140
141 PBoolean GetC1() const;
142 void SetC1(PBoolean c1);
143
144 PBoolean GetC0() const;
145 void SetC0(PBoolean c0);
146
147 BYTE GetSegmentNumber() const;
148 void SetSegmentNumber(BYTE segmentNumber);
149
150 BYTE *GetClientDataPtr() const;
151
152 PINDEX GetClientDataSize() const;
153 void SetClientDataSize(PINDEX size);
154
155 PBoolean DecodeAnnexQ(const BYTE *data, PINDEX size);
156 PBoolean DecodeHDLC(const BYTE *data, PINDEX size);
157
158 private:
159 PINDEX GetHeaderSize() const;
160 };
161
162 #endif // OPAL_H224_H224_H
163