Home | History | Annotate | Download | only in include
      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 //
     20 // RFC3640_payload_parser.h
     21 //
     22 // Payload parser for RFC3640 RTP format (mpeg4 for DVB and others).
     23 //
     24 // This implementation is intentionally incomplete.  It does not implement
     25 // interleaved access units (AUs) nor does it handle missing "crucial" AUs.
     26 // Neither of which are common for DVB.
     27 //
     28 // This implementation currently only supports AAC high-bit-rate (AAChbr).
     29 // Other modes can be added by implementing mediaInfo parsing in Init.
     30 //
     31 ///////////////////////////////////////////////////////////////////////////////
     32 
     33 #ifndef RFC3640_PAYLOAD_PARSER_H_INCLUDED
     34 #define RFC3640_PAYLOAD_PARSER_H_INCLUDED
     35 
     36 #ifndef PAYLOAD_PARSER_H_INCLUDED
     37 #include "payload_parser.h"
     38 #endif
     39 
     40 class RFC3640PayloadParser : public IPayloadParser
     41 {
     42     public:
     43         OSCL_IMPORT_REF          RFC3640PayloadParser(void);
     44         OSCL_IMPORT_REF virtual ~RFC3640PayloadParser();
     45 
     46         //Initializes the parser.
     47         //This is where the parser gets the SDP MIME types
     48         //that configure the RFC3640 header format.
     49         OSCL_IMPORT_REF bool Init(mediaInfo* config);
     50 
     51         //This parses the input payload packets, skips over the AU headers,
     52         //and returns the new pointers as fragments in the output payload
     53         //fragment vector.
     54         OSCL_IMPORT_REF PayloadParserStatus Parse(const Payload& inputPacket,
     55                 Oscl_Vector<Payload, OsclMemAllocator>& vParsedPayloads);
     56 
     57         //Not supported or implemented.
     58         OSCL_IMPORT_REF void Reposition(const bool   adjustSequence = false,
     59                                         const uint32 stream = 0,
     60                                         const uint32 seqnum = 0);
     61 
     62         //Not supported or implemented.
     63         OSCL_IMPORT_REF uint32 GetMinCurrTimestamp(void);
     64 
     65     private:
     66         //These correspond to the MIME types specified in RFC3640.
     67         bool   headersPresent;
     68         uint32 headersLength;
     69         uint32 sizeLength;
     70         uint32 indexLength;
     71         uint32 indexDeltaLength;
     72         uint32 CTSDeltaLength;
     73         uint32 DTSDeltaLength;
     74         bool   randomAccessIndication;
     75         uint32 auxDataSizeLength;
     76 };
     77 
     78 #endif //RFC3640_PAYLOAD_PARSER_H_INCLUDED
     79