reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
MediaControlContents.hxx
Go to the documentation of this file.
1#if !defined(RESIP_MEDIACONTROLCONTENTS_HXX)
2#define RESIP_MEDIACONTROLCONTENTS_HXX
3
5#include "rutil/Data.hxx"
6#include "rutil/HashMap.hxx"
8#include "rutil/XMLCursor.hxx"
9
10namespace resip
11{
12
13/* Provides a way to handle the application/media_control+xml
14 content-type from SIP INFO messages.
15 Attempts to adhere to the IETF RFC 5168
16 https://datatracker.ietf.org/doc/html/rfc5168
17*/
18
20{
21
22 public:
23
25 {
26 public:
27
29 {
30 public:
31 typedef std::set<Data> StreamIDList;
33 VCPrimitive() : mPictureFastUpdate(false) {};
34
35 VCPrimitive(const VCPrimitive& rhs);
37
38 void parseVCPrimitive(XMLCursor& xml);
40
41 /* stream_id is the label attribute from SDP. See RFC 4574 */
42 const StreamIDList& streamIDs() const { return mStreamIDs; };
43 StreamIDList& streamIDs() { return mStreamIDs; };
44
45 const bool& pictureFastUpdate() const { return mPictureFastUpdate; };
46 bool& pictureFastUpdate() { return mPictureFastUpdate; };
47
48 private:
49 StreamIDList mStreamIDs;
50 bool mPictureFastUpdate;
51 };
52
53 typedef std::vector<Data> GeneralErrorList;
54
55 typedef std::vector<VCPrimitive> VCPrimitiveList;
56
57 MediaControl(const VCPrimitive::StreamIDList& streamIDs, bool pictureFastUpdate);
60
61 MediaControl(const MediaControl& rhs);
63
65 void parse(ParseBuffer& pb);
67
68 bool isError() const { return !mGeneralErrors.empty(); };
69 const GeneralErrorList& generalErrors() const { return mGeneralErrors; };
70
71 const VCPrimitiveList& vCPrimitives() const { return mVCPrimitives; };
72 VCPrimitiveList& vCPrimitives() { return mVCPrimitives; };
73
74 private:
75 GeneralErrorList mGeneralErrors;
76 VCPrimitiveList mVCPrimitives;
77
79 };
80
83 virtual ~MediaControlContents();
84
86
91 virtual Contents* clone() const;
92
97 MediaControl& mediaControl() {checkParsed(); return mMediaControl;}
98 const MediaControl& mediaControl() const {checkParsed(); return mMediaControl;}
100 virtual void parse(ParseBuffer& pb);
101 static const Mime& getStaticType() ;
102
103 static bool init();
104
105 private:
106 MediaControlContents(const Data& data, const Mime& contentTypes);
107 MediaControl mMediaControl;
108};
109
111
112}
113
114
115#endif
116
117/* ====================================================================
118 *
119 * Copyright (c) 2021, Daniel Pocock, https://danielpocock.com
120 * Copyright (c) 2021, Software Freedom Institute LLC, https://softwarefreedom.institute
121 *
122 * Redistribution and use in source and binary forms, with or without
123 * modification, are permitted provided that the following conditions
124 * are met:
125 *
126 * 1. Redistributions of source code must retain the above copyright
127 * notice, this list of conditions and the following disclaimer.
128 *
129 * 2. Redistributions in binary form must reproduce the above copyright
130 * notice, this list of conditions and the following disclaimer in
131 * the documentation and/or other materials provided with the
132 * distribution.
133 *
134 * 3. Neither the name of the author(s) nor the names of any contributors
135 * may be used to endorse or promote products derived from this software
136 * without specific prior written permission.
137 *
138 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
139 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
140 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
141 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
142 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
143 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
144 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
145 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
146 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
147 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
148 * SUCH DAMAGE.
149 *
150 * ====================================================================
151 *
152 *
153 */
154
Wraps your platform's implementation of hash_map, hash_multimap, and hash_set.
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
void checkParsed() const
const VCPrimitiveList & vCPrimitives() const
const GeneralErrorList & generalErrors() const
MediaControl & operator=(const MediaControl &rhs)
EncodeStream & encode(EncodeStream &) const
virtual Contents * clone() const
duplicate an MediaControlContents object
virtual void parse(ParseBuffer &pb)
const MediaControl & mediaControl() const
MediaControl & mediaControl()
get the parsed payload
MediaControlContents & operator=(const MediaControlContents &rhs)
virtual EncodeStream & encodeParsed(EncodeStream &str) const
static const Mime & getStaticType()
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
dcm! – add UnusedChecking(_enum) below;
static bool invokeMediaControlContentsInit
#define EncodeStream
void list()
Definition userAdmin.cxx:66