summaryrefslogtreecommitdiff
path: root/src/mctrl.c
blob: d3abab8611f4b5a90603205982b0099d0501554f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
 * @file mctrl.c  Media Control
 *
 * Copyright (C) 2010 Creytiv.com
 */
#include <re.h>
#include <baresip.h>
#include "core.h"


/*
 * RFC 5168 XML Schema for Media Control
 * note: deprecated, use RTCP FIR instead
 *
 *
 * Example XML Document:
 *
 * <pre>

   <?xml version="1.0" encoding="utf-8"?>
     <media_control>
       <vc_primitive>
         <to_encoder>
           <picture_fast_update>
	   </picture_fast_update>
	 </to_encoder>
       </vc_primitive>
     </media_control>

  </pre>
 */
int mctrl_handle_media_control(struct pl *body, bool *pfu)
{
	if (!body)
		return EINVAL;

	/* XXX: Poor-mans XML parsing (use xml-parser instead) */
	if (0 == re_regex(body->p, body->l, "picture_fast_update")) {
		if (pfu)
			*pfu = true;
	}

	return 0;
}