- Main Page
- Classes
- Files

# Ap4ObjectDescriptor.h

Go to the documentation of this file.

    00001 /*****************************************************************
    00002 |
    00003 |    AP4 - Object Descriptor
    00004 |
    00005 |    Copyright 2002-2008 Gilles Boccon-Gibod & Julien Boeuf
    00006 |
    00007 |
    00008 |    This file is part of Bento4/AP4 (MP4 Atom Processing Library).
    00009 |
    00010 |    Unless you have obtained Bento4 under a difference license,
    00011 |    this version of Bento4 is Bento4|GPL.
    00012 |    Bento4|GPL is free software; you can redistribute it and/or modify
    00013 |    it under the terms of the GNU General Public License as published by
    00014 |    the Free Software Foundation; either version 2, or (at your option)
    00015 |    any later version.
    00016 |
    00017 |    Bento4|GPL is distributed in the hope that it will be useful,
    00018 |    but WITHOUT ANY WARRANTY; without even the implied warranty of
    00019 |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00020 |    GNU General Public License for more details.
    00021 |
    00022 |    You should have received a copy of the GNU General Public License
    00023 |    along with Bento4|GPL; see the file COPYING.  If not, write to the
    00024 |    Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
    00025 |    02111-1307, USA.
    00026 |
    00027  ****************************************************************/
    00028
    00029 #ifndef _AP4_OBJECT_DESCRIPTOR_H_
    00030 #define _AP4_OBJECT_DESCRIPTOR_H_
    00031
    00032 /*----------------------------------------------------------------------
    00033 |   includes
    00034 +---------------------------------------------------------------------*/
    00035 #include "Ap4List.h"
    00036 #include "Ap4String.h"
    00037 #include "Ap4Descriptor.h"
    00038 #include "Ap4Command.h"
    00039
    00040 /*----------------------------------------------------------------------
    00041 |   class references
    00042 +---------------------------------------------------------------------*/
    00043 class AP4_ByteStream;
    00044
    00045 /*----------------------------------------------------------------------
    00046 |   constants
    00047 +---------------------------------------------------------------------*/
    00048 const AP4_UI08 AP4_DESCRIPTOR_TAG_OD      = 0x01;
    00049 const AP4_UI08 AP4_DESCRIPTOR_TAG_IOD     = 0x02;
    00050 const AP4_UI08 AP4_DESCRIPTOR_TAG_MP4_OD  = 0x11;
    00051 const AP4_UI08 AP4_DESCRIPTOR_TAG_MP4_IOD = 0x10;
    00052
    00053 /*----------------------------------------------------------------------
    00054 |   AP4_ObjectDescriptor
    00055 +---------------------------------------------------------------------*/
    00056 class AP4_ObjectDescriptor : public AP4_Descriptor
    00057 {
    00058  public:
    00059     // methods
    00060     AP4_ObjectDescriptor(AP4_ByteStream& stream,
    00061                          AP4_UI08        tag,
    00062                          AP4_Size        header_size,
    00063                          AP4_Size        payload_size);
    00064     virtual ~AP4_ObjectDescriptor();
    00065     virtual AP4_Result AddSubDescriptor(AP4_Descriptor* descriptor);
    00066     virtual const AP4_Descriptor* FindSubDescriptor(AP4_UI08 tag) const;
    00067     virtual AP4_Result WriteFields(AP4_ByteStream& stream);
    00068     virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
    00069
    00070     // accessors
    00071     AP4_UI16 GetObjectDescriptorId() const { return m_ObjectDescriptorId; }
    00072     bool     GetUrlFlag()            const { return m_UrlFlag; }
    00073     const AP4_String& GetUrl()       const { return m_Url;}
    00074
    00075  protected:
    00076     // constructor
    00077     AP4_ObjectDescriptor(AP4_UI08 tag, AP4_Size header_size, AP4_Size payload_size);
    00078
    00079     // members
    00080     AP4_UI16                         m_ObjectDescriptorId;
    00081     bool                             m_UrlFlag;
    00082     AP4_String                       m_Url;
    00083     mutable AP4_List<AP4_Descriptor> m_SubDescriptors;
    00084 };
    00085
    00086 /*----------------------------------------------------------------------
    00087 |   AP4_InitialObjectDescriptor
    00088 +---------------------------------------------------------------------*/
    00089 class AP4_InitialObjectDescriptor : public AP4_ObjectDescriptor
    00090 {
    00091  public:
    00092     // methods
    00093     AP4_InitialObjectDescriptor(AP4_ByteStream& stream,
    00094                                 AP4_UI08        tag,
    00095                                 AP4_Size        header_size,
    00096                                 AP4_Size        payload_size);
    00097     virtual AP4_Result WriteFields(AP4_ByteStream& stream);
    00098     virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
    00099
    00100     // accessors
    00101     bool     GetIncludeProfileLevelFlag()        const { return m_IncludeInlineProfileLevelFlag; }
    00102     AP4_UI08 GetOdProfileLevelIndication()       const { return m_OdProfileLevelIndication; }
    00103     AP4_UI08 GetSceneProfileLevelIndication()    const { return m_SceneProfileLevelIndication; }
    00104     AP4_UI08 GetAudioProfileLevelIndication()    const { return m_AudioProfileLevelIndication; }
    00105     AP4_UI08 GetVisualProfileLevelIndication()   const { return m_VisualProfileLevelIndication; }
    00106     AP4_UI08 GetGraphicsProfileLevelIndication() const { return m_GraphicsProfileLevelIndication; }
    00107
    00108  private:
    00109     // members
    00110     bool     m_IncludeInlineProfileLevelFlag;
    00111     AP4_UI08 m_OdProfileLevelIndication;
    00112     AP4_UI08 m_SceneProfileLevelIndication;
    00113     AP4_UI08 m_AudioProfileLevelIndication;
    00114     AP4_UI08 m_VisualProfileLevelIndication;
    00115     AP4_UI08 m_GraphicsProfileLevelIndication;
    00116 };
    00117
    00118 /*----------------------------------------------------------------------
    00119 |   AP4_DescriptorUpdateCommand
    00120 +---------------------------------------------------------------------*/
    00125 class AP4_DescriptorUpdateCommand : public AP4_Command
    00126 {
    00127  public:
    00128     // methods
    00129     AP4_DescriptorUpdateCommand(AP4_ByteStream& stream,
    00130                                 AP4_UI08        tag,
    00131                                 AP4_Size        header_size,
    00132                                 AP4_Size        payload_size);
    00133     virtual ~AP4_DescriptorUpdateCommand();
    00134     virtual AP4_Result AddDescriptor(AP4_Descriptor* descriptor);
    00135     virtual AP4_Result WriteFields(AP4_ByteStream& stream);
    00136     virtual AP4_Result Inspect(AP4_AtomInspector& inspector);
    00137
    00138     // accessors
    00139     const AP4_List<AP4_Descriptor>& GetDescriptors() { return m_Descriptors; }
    00140
    00141  protected:
    00142     // members
    00143     mutable AP4_List<AP4_Descriptor> m_Descriptors;
    00144 };
    00145
    00146 #endif // _AP4_OBJECT_DESCRIPTOR_H_