Home | History | Annotate | Download | only in src
      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     This PVA_FF_BaseDescriptor Class
     20 */
     21 
     22 #define IMPLEMENT_BaseDescriptor
     23 
     24 #include "basedescriptor.h"
     25 #include "atomutils.h"
     26 
     27 
     28 // Constructor
     29 PVA_FF_BaseDescriptor::PVA_FF_BaseDescriptor(uint8 tag)
     30 {
     31     _sizeOfClass = 0;
     32     _sizeOfSizeField = DEFAULT_DESCRIPTOR_SIZE; // 1
     33     _tag = tag;
     34 }
     35 
     36 // Destructor
     37 PVA_FF_BaseDescriptor::~PVA_FF_BaseDescriptor()
     38 {
     39     // Empty
     40 }
     41 
     42 // Rendering the PVA_FF_BaseDescriptor members in proper format (bitlengths, etc.)
     43 // to an ostream
     44 int
     45 PVA_FF_BaseDescriptor::renderBaseDescriptorMembers(MP4_AUTHOR_FF_FILE_IO_WRAP *fp) const
     46 {
     47     PVA_FF_AtomUtils::render8(fp, getTag());
     48     int32 numBytesRendered = 1;
     49 
     50     // Render attributes of the PVA_FF_BaseDescriptor class
     51     int32 numBytes = renderSizeOfClassToFileStream(fp);
     52 
     53     if (numBytes > 0)
     54     {
     55         numBytesRendered += numBytes;
     56     }
     57     else
     58     {
     59         numBytesRendered = 0;
     60     }
     61 
     62     return numBytesRendered;
     63 }
     64 
     65 
     66 
     67