1
/* $Id: h263_packetizer.h 3715 2011-08-19 09:35:25Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
#ifndef __PJMEDIA_H263_PACKETIZER_H__
20
#define __PJMEDIA_H263_PACKETIZER_H__
24
* @file h263_packetizer.h
25
* @brief Packetizes/unpacketizes H.263 bitstream into RTP payload.
35
* Opaque declaration for H.263 packetizer.
37
typedef struct pjmedia_h263_packetizer pjmedia_h263_packetizer;
41
* Enumeration of H.263 packetization modes.
46
* H.263 RTP packetization using RFC 4629.
48
PJMEDIA_H263_PACKETIZER_MODE_RFC4629,
51
* H.263 RTP packetization using legacy RFC 2190.
52
* This is currently not supported.
54
PJMEDIA_H263_PACKETIZER_MODE_RFC2190,
56
} pjmedia_h263_packetizer_mode;
60
* H.263 packetizer configuration.
62
typedef struct pjmedia_h263_packetizer_cfg
65
* Maximum payload length.
66
* Default: PJMEDIA_MAX_MTU
72
* Default: PJMEDIA_H263_PACKETIZER_MODE_RFC4629
74
pjmedia_h263_packetizer_mode mode;
76
} pjmedia_h263_packetizer_cfg;
80
* Create H.263 packetizer.
82
* @param pool The memory pool.
83
* @param cfg Packetizer settings, if NULL, default setting
85
* @param p_pktz Pointer to receive the packetizer.
87
* @return PJ_SUCCESS on success.
89
PJ_DECL(pj_status_t) pjmedia_h263_packetizer_create(
91
const pjmedia_h263_packetizer_cfg *cfg,
92
pjmedia_h263_packetizer **p_pktz);
96
* Generate an RTP payload from a H.263 picture bitstream. Note that this
97
* function will apply in-place processing, so the bitstream may be modified
98
* during the packetization.
100
* @param pktz The packetizer.
101
* @param bits The picture bitstream to be packetized.
102
* @param bits_len The length of the bitstream.
103
* @param bits_pos The bitstream offset to be packetized.
104
* @param payload The output payload.
105
* @param payload_len The output payload length.
107
* @return PJ_SUCCESS on success.
109
PJ_DECL(pj_status_t) pjmedia_h263_packetize(pjmedia_h263_packetizer *pktz,
113
const pj_uint8_t **payload,
114
pj_size_t *payload_len);
118
* Append an RTP payload to an H.263 picture bitstream. Note that in case of
119
* noticing packet lost, application should keep calling this function with
120
* payload pointer set to NULL, as the packetizer need to update its internal
123
* @param pktz The packetizer.
124
* @param payload The payload to be unpacketized.
125
* @param payload_len The payload length.
126
* @param bits The bitstream buffer.
127
* @param bits_size The bitstream buffer size.
128
* @param bits_pos The bitstream offset to put the unpacketized payload
129
* in the bitstream, upon return, this will be updated
130
* to the latest offset as a result of the unpacketized
133
* @return PJ_SUCCESS on success.
135
PJ_DECL(pj_status_t) pjmedia_h263_unpacketize(pjmedia_h263_packetizer *pktz,
136
const pj_uint8_t *payload,
137
pj_size_t payload_len,
146
#endif /* __PJMEDIA_H263_PACKETIZER_H__ */