ROHC compression/decompression library
decomp_scaled_rtp_ts.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007,2008 CNES
3  * Copyright 2011,2012,2013 Didier Barvaux
4  * Copyright 2007,2008 Thales Alenia Space
5  * Copyright 2007,2010,2012,2013,2014 Viveris Technologies
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file schemes/decomp_scaled_rtp_ts.h
24  * @brief Scaled RTP Timestamp decoding
25  * @author David Moreau from TAS
26  * @author Didier Barvaux <didier@barvaux.org>
27  */
28 
29 #ifndef ROHC_DECOMP_SCHEMES_SCALED_RTP_TS_H
30 #define ROHC_DECOMP_SCHEMES_SCALED_RTP_TS_H
31 
32 #include "rohc_traces.h"
33 
34 #include <stdlib.h>
35 #include <stdint.h>
36 #ifdef __KERNEL__
37 # include <linux/types.h>
38 #else
39 # include <stdbool.h>
40 #endif
41 
42 
43 /* The definition of the scaled RTP Timestamp decoding context is private */
44 struct ts_sc_decomp;
45 
46 
47 /*
48  * Function prototypes
49  */
50 
52  void *const trace_cb_priv)
53  __attribute__((warn_unused_result));
54 void rohc_ts_scaled_free(struct ts_sc_decomp *const ts_scaled)
55  __attribute__((nonnull(1)));
56 
57 void ts_update_context(struct ts_sc_decomp *const ts_sc,
58  const uint32_t ts,
59  const uint16_t sn);
60 
61 void d_record_ts_stride(struct ts_sc_decomp *const ts_sc,
62  const uint32_t ts_stride);
63 
64 bool ts_decode_unscaled_bits(struct ts_sc_decomp *const ts_sc,
65  const uint32_t ts_unscaled_bits,
66  const size_t ts_unscaled_bits_nr,
67  uint32_t *const decoded_ts)
68  __attribute__((warn_unused_result));
69 
70 bool ts_decode_scaled_bits(struct ts_sc_decomp *const ts_sc,
71  const uint32_t ts_scaled_bits,
72  const size_t ts_scaled_bits_nr,
73  uint32_t *const decoded_ts)
74  __attribute__((warn_unused_result));
75 
76 uint32_t ts_deduce_from_sn(struct ts_sc_decomp *const ts_sc,
77  const uint16_t sn)
78  __attribute__((warn_unused_result));
79 
80 #endif
81 
void d_record_ts_stride(struct ts_sc_decomp *const ts_sc, const uint32_t ts_stride)
Store the newly-parsed TS_STRIDE value.
Definition: decomp_scaled_rtp_ts.c:240
uint32_t ts_scaled
The last computed or received TS_SCALED value (validated by CRC)
Definition: decomp_scaled_rtp_ts.c:58
bool ts_decode_unscaled_bits(struct ts_sc_decomp *const ts_sc, const uint32_t ts_unscaled_bits, const size_t ts_unscaled_bits_nr, uint32_t *const decoded_ts)
Decode timestamp (TS) value with some LSB bits of the unscaled value.
Definition: decomp_scaled_rtp_ts.c:261
The scaled RTP Timestamp decoding context.
Definition: decomp_scaled_rtp_ts.c:52
void(* rohc_trace_callback2_t)(void *const priv_ctxt, const rohc_trace_level_t level, const rohc_trace_entity_t entity, const int profile, const char *const format,...)
The function prototype for the trace callback.
Definition: rohc_traces.h:118
void ts_update_context(struct ts_sc_decomp *const ts_sc, const uint32_t ts, const uint16_t sn)
Store a new timestamp.
Definition: decomp_scaled_rtp_ts.c:178
struct ts_sc_decomp * d_create_sc(rohc_trace_callback2_t trace_cb, void *const trace_cb_priv)
Create the scaled RTP Timestamp decoding context.
Definition: decomp_scaled_rtp_ts.c:108
uint32_t ts
Definition: decomp_scaled_rtp_ts.c:66
uint16_t sn
The sequence number (SN)
Definition: decomp_scaled_rtp_ts.c:73
uint32_t ts_stride
The last computed or received TS_STRIDE value (validated by CRC)
Definition: decomp_scaled_rtp_ts.c:55
void rohc_ts_scaled_free(struct ts_sc_decomp *const ts_scaled)
Destroy the given ts_sc_decomp object.
Definition: decomp_scaled_rtp_ts.c:163
bool ts_decode_scaled_bits(struct ts_sc_decomp *const ts_sc, const uint32_t ts_scaled_bits, const size_t ts_scaled_bits_nr, uint32_t *const decoded_ts)
Decode timestamp (TS) value with some LSB bits of the TS_SCALED value.
Definition: decomp_scaled_rtp_ts.c:353
ROHC definitions for traces.
uint32_t ts_deduce_from_sn(struct ts_sc_decomp *const ts_sc, const uint16_t sn)
Deduct timestamp (TS) from Sequence Number (SN)
Definition: decomp_scaled_rtp_ts.c:434