root/rat/trunk/channel.h @ 2765

Revision 2765, 3.9 KB (checked in by ucacoxh, 15 years ago)

- Consistency fixes for channel coder query functions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * FILE:      channel.h
3 * AUTHOR(S): Orion Hodson
4 *     
5 * $Revision$
6 * $Date$
7 *
8 * Copyright (c) 1999 University College London
9 * All rights reserved.
10 *
11 */
12
13#ifndef   __NEW_CHANNEL_H__
14#define   __NEW_CHANNEL_H__
15
16#include "playout.h"
17#include "channel_types.h"
18
19struct s_channel_state;
20
21/* Channel coder query functions:
22 * channel_get_coder_count returns number of available channel coders,
23 * and channel_get_coder_details copies details of idx'th coder into ccd.
24 */
25
26u_int32             channel_get_coder_count   (void);
27const cc_details_t* channel_get_coder_details (u_int32 idx);
28const cc_details_t* channel_get_null_coder    (void);
29
30/* channel_get_coder_identity fills coder name and descriptor into ccd */
31const cc_details_t* channel_get_coder_identity(struct s_channel_state *cs);
32
33/* Don't use these two functions directly use macros channel_encoder_{create, destory, reset},
34 * and channel_encoder_{create, destory, reset} instead.
35 */
36
37int       _channel_coder_create      (cc_id_t id, struct s_channel_state **cs, int is_encoder);
38void      _channel_coder_destroy     (struct s_channel_state **cs, int is_encoder);
39int       _channel_coder_reset       (struct s_channel_state *cs,  int is_encoder);   
40
41/* Encoder specifics *********************************************************/
42
43#define   channel_encoder_create(id, cs)  _channel_coder_create  (id, cs, TRUE)
44#define   channel_encoder_destroy(cs)     _channel_coder_destroy (cs, TRUE)
45#define   channel_encoder_reset(cs)       _channel_coder_reset   (cs, TRUE)
46
47int       channel_encoder_set_units_per_packet (struct s_channel_state *cs, u_int16);
48u_int16   channel_encoder_get_units_per_packet (struct s_channel_state *cs);
49
50int       channel_encoder_set_parameters (struct s_channel_state *cs, char *cmd);
51int       channel_encoder_get_parameters (struct s_channel_state *cs, char *cmd, int cmd_len);
52
53int       channel_encoder_encode (struct s_channel_state  *cs,
54                                  struct s_pb *media_buffer,
55                                  struct s_pb *channel_buffer);
56
57/* Decoder specifics *********************************************************/
58#define   channel_decoder_create(id, cs)  _channel_coder_create  (id, cs, FALSE)
59#define   channel_decoder_destroy(cs)     _channel_coder_destroy (cs, FALSE)
60#define   channel_decoder_reset(cs)       _channel_coder_reset   (cs, FALSE)
61
62int       channel_decoder_decode (struct s_channel_state  *cs,
63                                  struct s_pb *channel_buffer,
64                                  struct s_pb *media_buffer,
65                                  ts_t                     now);
66
67int       channel_decoder_matches (cc_id_t                 cid,
68                                   struct s_channel_state *cs);
69
70int       channel_get_compatible_codec (u_int8  pt,
71                                        u_char *data,
72                                        u_int32 data_len);
73
74int       channel_verify_and_stat (cc_id_t  cid,
75                                   u_int8   pktpt,
76                                   u_char  *data,
77                                   u_int32  data_len,
78                                   u_int16 *units_per_packet,
79                                   u_char  *codec_pt);
80
81int       channel_describe_data   (cc_id_t cid,
82                                   u_int8  pktpt,
83                                   u_char *data,
84                                   u_int32 data_len,
85                                   char   *outstr,
86                                   u_int32 out_len);
87                                   
88
89/* Payload mapping functions */
90cc_id_t   channel_coder_get_by_payload (u_int8 pt);
91u_int8    channel_coder_get_payload    (struct s_channel_state* st, u_int8 media_pt);   
92int       channel_coder_exist_payload  (u_int8 pt);
93
94/* Layered coding functions */
95u_int8    channel_coder_get_layers     (cc_id_t cid);
96
97#endif /* __NEW_CHANNEL_H__ */
Note: See TracBrowser for help on using the browser.