• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
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
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 
19 #ifndef BASE_MEDIAINFO_PARSER_H
20 #define BASE_MEDIAINFO_PARSER_H
21 #include "oscl_mem.h"
22 #include "sdp_info.h"
23 #include "sdp_error.h"
24 #include "media_info.h"
25 #include "sdp_parsing_utils.h"
26 #include "oscl_mem.h"
27 #include "pvlogger.h"
28 
29 #define PVMF_SDP_PARSER_LOGERROR(m) PVLOGGER_LOGMSG(PVLOGMSG_INST_REL,iLogger,PVLOGMSG_ERR,m);
30 #define PVMF_SDP_PARSER_LOGWARNING(m) PVLOGGER_LOGMSG(PVLOGMSG_INST_REL,iLogger,PVLOGMSG_WARNING,m);
31 #define PVMF_SDP_PARSER_LOGINFOHI(m) PVLOGGER_LOGMSG(PVLOGMSG_INST_HLDBG,iLogger,PVLOGMSG_INFO,m);
32 #define PVMF_SDP_PARSER_LOGINFOMED(m) PVLOGGER_LOGMSG(PVLOGMSG_INST_MLDBG,iLogger,PVLOGMSG_INFO,m);
33 #define PVMF_SDP_PARSER_LOGINFOLOW(m) PVLOGGER_LOGMSG(PVLOGMSG_INST_LLDBG,iLogger,PVLOGMSG_INFO,m);
34 #define PVMF_SDP_PARSER_LOGINFO(m) PVMF_SDP_PARSER_LOGINFOMED(m)
35 
36 typedef Oscl_Vector<int, SDPParserAlloc> payloadVector;
37 class SDPBaseMediaInfoParser
38 {
39     public:
SDPBaseMediaInfoParser()40         SDPBaseMediaInfoParser()
41         {
42             iLogger = PVLogger::GetLoggerObject("SDPBaseMediaInfoParser");
43         };
~SDPBaseMediaInfoParser()44         virtual ~SDPBaseMediaInfoParser() {};
45         virtual SDP_ERROR_CODE parseMediaInfo(const char *buff, const int index, SDPInfo *sdp,
46                                               payloadVector payload_vec, bool isSipSdp, int alt_id = 0, bool alt_def_id = false) = 0;
47         SDP_ERROR_CODE baseMediaInfoParser(const char *, mediaInfo *, const int, const int, bool, bool isSipSdp);
48         SDP_ERROR_CODE getAltDefaultId(const char* start, const char *end, uint32 &defaultId);
49         SDP_ERROR_CODE setDependentMediaId(const char *start, int length, mediaInfo *mediaPtr, int mediaId);
50         bool lookForMediaId(const char *startPtr, const char* endPtr, int mediaId);
51     protected:
52         PVLogger* iLogger;
53 };
54 
55 #endif//BASE_MEDIAINFO_PARSER_H
56