summaryrefslogtreecommitdiffstats
path: root/tinyDAV/src/codecs/msrp/tdav_codec_msrp.c
blob: a39e90b699880d744699309f3ef8f61003afef68 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* Copyright (C) 2010-2011 Mamadou Diop.
*
*
* This file is part of Open Source Doubango Framework.
*
* DOUBANGO is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DOUBANGO is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DOUBANGO.
*
*/

/**@file tdav_codec_msrp.c
 * @brief The Message Session Relay Protocol (MSRP) fake codec.
 * Used for both Message (RFC 4975) and file transfer (RFC 5547).
 *
 */
#include "tinydav/codecs/msrp/tdav_codec_msrp.h"

#include "tsk_memory.h"
#include "tsk_debug.h"

/* ============ MSRP Plugin interface ================= */
#define tdav_codec_msrp_open tsk_null
#define tdav_codec_msrp_close tsk_null
#define tdav_codec_msrp_sdp_att_get tsk_null
#define tdav_codec_msrp_sdp_att_get tsk_null
#define tdav_codec_msrp_encode tsk_null
#define tdav_codec_msrp_decode tsk_null

static tsk_bool_t tdav_codec_msrp_sdp_att_match(const tmedia_codec_t* codec, const char* att_name, const char* att_value)
{
    /* always match */
    return tsk_true;
}

//
//	MSRP Plugin definition
//

/* constructor */
static tsk_object_t* tdav_codec_msrp_ctor(tsk_object_t * self, va_list * app)
{
    tdav_codec_msrp_t *msrp = self;
    if(msrp) {
        /* init base: called by tmedia_codec_create() */
        /* init self */
    }
    return self;
}
/* destructor */
static tsk_object_t* tdav_codec_msrp_dtor(tsk_object_t * self)
{
    tdav_codec_msrp_t *msrp = self;
    if(msrp) {
        /* deinit base */
        tmedia_codec_msrp_deinit(msrp);
        /* deinit self */
    }

    return self;
}
/* object definition */
static const tsk_object_def_t tdav_codec_msrp_def_s = {
    sizeof(tdav_codec_msrp_t),
    tdav_codec_msrp_ctor,
    tdav_codec_msrp_dtor,
    tmedia_codec_cmp,
};
/* plugin definition*/
static const tmedia_codec_plugin_def_t tdav_codec_msrp_plugin_def_s = {
    &tdav_codec_msrp_def_s,

    tmedia_msrp,
    tmedia_codec_id_none, // fake codec without real id
    "message",
    "MSRP fake codec",
    TMEDIA_CODEC_FORMAT_MSRP,
    tsk_false,
    0, // rate

    /* audio */
    {0},

    /* video */
    {0},

    tsk_null, // set()
    tdav_codec_msrp_open,
    tdav_codec_msrp_close,
    tdav_codec_msrp_encode,
    tdav_codec_msrp_decode,
    tdav_codec_msrp_sdp_att_match,
    tdav_codec_msrp_sdp_att_get
};
const tmedia_codec_plugin_def_t *tdav_codec_msrp_plugin_def_t = &tdav_codec_msrp_plugin_def_s;
OpenPOWER on IntegriCloud