UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mpf_jitter_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Id: mpf_jitter_buffer.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MPF_JITTER_BUFFER_H
20 #define MPF_JITTER_BUFFER_H
21 
22 /**
23  * @file mpf_jitter_buffer.h
24  * @brief Jitter Buffer
25  */
26 
27 #include "mpf_frame.h"
28 #include "mpf_codec.h"
29 #include "mpf_rtp_descriptor.h"
30 
32 
33 /** Jitter buffer write result */
34 typedef enum {
35  JB_OK, /**< successful write */
36  JB_DISCARD_NOT_ALLIGNED, /**< discarded write (frame isn't alligned to CODEC_FRAME_TIME_BASE) */
37  JB_DISCARD_TOO_LATE, /**< discarded write (frame is arrived too late) */
38  JB_DISCARD_TOO_EARLY, /**< discarded write (frame is arrived too early, buffer is full) */
39 } jb_result_t;
40 
41 /** Opaque jitter buffer declaration */
43 
44 
45 /** Create jitter buffer */
46 mpf_jitter_buffer_t* mpf_jitter_buffer_create(mpf_jb_config_t *jb_config, mpf_codec_descriptor_t *descriptor, mpf_codec_t *codec, apr_pool_t *pool);
47 
48 /** Destroy jitter buffer */
50 
51 /** Restart jitter buffer */
53 
54 /** Write audio data to jitter buffer */
55 jb_result_t mpf_jitter_buffer_write(mpf_jitter_buffer_t *jb, void *buffer, apr_size_t size, apr_uint32_t ts, apr_byte_t marker);
56 
57 /** Write named event to jitter buffer */
58 jb_result_t mpf_jitter_buffer_event_write(mpf_jitter_buffer_t *jb, const mpf_named_event_frame_t *named_event, apr_uint32_t ts, apr_byte_t marker);
59 
60 /** Read media frame from jitter buffer */
62 
63 /** Get current playout delay */
65 
67 
68 #endif /* MPF_JITTER_BUFFER_H */