rtpptdefs.h

Go to the documentation of this file.
00001 /* * 
00002  * This file is part of libnemesi
00003  *
00004  * Copyright (C) 2007 by LScube team <team@streaming.polito.it>
00005  * See AUTHORS for more details
00006  * 
00007  * libnemesi is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * libnemesi is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with libnemesi; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  *  
00021  * */
00022 
00028 #ifndef NEMESI_RTP_PT_DEFS_H
00029 #define NEMESI_RTP_PT_DEFS_H
00030 
00031 #ifdef HAVE_CONFIG_H
00032 #include <config.h>
00033 #endif
00034 #include <stdint.h>
00035 
00036 #define RTP_DEF_CLK_RATE 8000
00037 
00038 #define RTP_DEF_MAX_NAME_LEN 16
00039 
00040 typedef enum {
00041     AU = 0,
00042     VI = 1,
00043     AV = 2,
00044     NA = 3
00045 } rtp_media_type;
00046 
00047 #define RTP_ATTRS_ARRAY_DEF_SIZE 3
00048 
00049 typedef struct {
00050     char **data;
00051     uint32_t size;
00052     uint32_t allocated;
00053 } rtp_pt_attrs;
00054 
00055 #define RTP_PT_ATTRS_INITIALIZER {NULL, 0, 0}
00056 
00057 #define RTP_PT_COMMON_FIELDS \
00058         char name[RTP_DEF_MAX_NAME_LEN];              \
00059         rtp_media_type type;             \
00062         unsigned rate;                         \
00063         unsigned long prev_timestamp;                                      \
00064         rtp_pt_attrs attrs;                             \
00066         void *priv;         
00068 /* XXX audio and video fields must have different names, 
00069  * because they are used together in rtp_audio_video
00070  */
00071 #define RTP_AUDIO_FIELDS    uint8_t channels;    /* Channels */
00072 
00073 #define RTP_VIDEO_FIELDS
00074 
00075 typedef struct {
00076 RTP_PT_COMMON_FIELDS RTP_AUDIO_FIELDS} rtp_audio;
00077 
00078 typedef struct {
00079 RTP_PT_COMMON_FIELDS RTP_VIDEO_FIELDS} rtp_video;
00080 
00081 typedef struct {
00082 RTP_PT_COMMON_FIELDS RTP_AUDIO_FIELDS RTP_VIDEO_FIELDS} rtp_audio_video;
00083 
00084 typedef struct rtp_pt_def {
00085 RTP_PT_COMMON_FIELDS} rtp_pt;
00086 
00087 #define RTP_FMTS_ARRAY_DEF_SIZE 3
00088 typedef struct _rtp_fmts_list {
00089     unsigned pt;
00090     rtp_pt *rtppt;
00091     struct _rtp_fmts_list *next;
00092 } rtp_fmts_list;
00093 #define RTP_FMTS_INITIALIZER {0, NULL, NULL}
00094 
00095 #define RTP_PT(x) ((rtp_pt *)x)
00096 #define RTP_AUDIO(x) ((rtp_audio *)x)
00097 #define RTP_VIDEO(x) ((rtp_video *)x)
00098 #define RTP_AUDIO_VIDEO(x) ((rtp_audio_video *)x)
00099 
00100 //rtp_pt **rtpptdefs_new(void);
00101 void rtpptdefs_new(rtp_pt *[]);
00102 rtp_pt *rtp_pt_new(rtp_media_type mtype);
00103 int rtp_dynpt_set(rtp_pt * defs[], rtp_pt * pt, uint8_t value);
00104 int rtp_dynpt_encname(rtp_pt * defs[], uint8_t value, char *enc_name);
00105 
00107 //void rtp_pt_attrs_init(rtp_pt_attrs *);
00108 int rtp_pt_attr_add(rtp_pt * defs[], uint8_t value, char *);
00109 
00110 #endif /* NEMESI_RTP_PT_DEFS_H */

Generated on Tue Feb 3 03:10:02 2009 for libnemesi by  doxygen 1.5.4