Ap4File.h

Go to the documentation of this file.
00001 /*****************************************************************
00002 |
00003 |    AP4 - File 
00004 |
00005 |    Copyright 2002-2006 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_FILE_H_
00030 #define _AP4_FILE_H_
00031 
00032 /*----------------------------------------------------------------------
00033 |   includes
00034 +---------------------------------------------------------------------*/
00035 #include "Ap4Types.h"
00036 #include "Ap4List.h"
00037 #include "Ap4AtomFactory.h"
00038 
00039 /*----------------------------------------------------------------------
00040 |   class references
00041 +---------------------------------------------------------------------*/
00042 class AP4_ByteStream;
00043 class AP4_Movie;
00044 class AP4_FtypAtom;
00045 
00046 /*----------------------------------------------------------------------
00047 |   file type/brands
00048 +---------------------------------------------------------------------*/
00049 const AP4_UI32 AP4_FILE_BRAND_QT__ = AP4_ATOM_TYPE('q','t',' ',' ');
00050 const AP4_UI32 AP4_FILE_BRAND_ISOM = AP4_ATOM_TYPE('i','s','o','m');
00051 const AP4_UI32 AP4_FILE_BRAND_MP41 = AP4_ATOM_TYPE('m','p','4','1');
00052 const AP4_UI32 AP4_FILE_BRAND_MP42 = AP4_ATOM_TYPE('m','p','4','2');
00053 const AP4_UI32 AP4_FILE_BRAND_3GP1 = AP4_ATOM_TYPE('3','g','p','1');
00054 const AP4_UI32 AP4_FILE_BRAND_3GP2 = AP4_ATOM_TYPE('3','g','p','2');
00055 const AP4_UI32 AP4_FILE_BRAND_3GP3 = AP4_ATOM_TYPE('3','g','p','3');
00056 const AP4_UI32 AP4_FILE_BRAND_3GP4 = AP4_ATOM_TYPE('3','g','p','4');
00057 const AP4_UI32 AP4_FILE_BRAND_3GP5 = AP4_ATOM_TYPE('3','g','p','5');
00058 const AP4_UI32 AP4_FILE_BRAND_3G2A = AP4_ATOM_TYPE('3','g','2','a');
00059 const AP4_UI32 AP4_FILE_BRAND_MMP4 = AP4_ATOM_TYPE('m','m','p','4');
00060 const AP4_UI32 AP4_FILE_BRAND_M4A_ = AP4_ATOM_TYPE('M','4','A',' ');
00061 const AP4_UI32 AP4_FILE_BRAND_M4P_ = AP4_ATOM_TYPE('M','4','P',' ');
00062 const AP4_UI32 AP4_FILE_BRAND_MJP2 = AP4_ATOM_TYPE('m','j','p','2');
00063 
00064 /*----------------------------------------------------------------------
00065 |   AP4_File
00066 +---------------------------------------------------------------------*/
00067 class AP4_File {
00068 public:
00069     // constructors and destructor
00070     AP4_File(AP4_Movie* movie);
00071     AP4_File(AP4_ByteStream& stream, 
00072              AP4_AtomFactory& atom_factory = AP4_DefaultAtomFactory::Instance);
00073     virtual ~AP4_File();
00074 
00075     // methods
00076     AP4_List<AP4_Atom>& GetOtherAtoms() { return m_OtherAtoms;}
00077     AP4_Movie*          GetMovie()      { return m_Movie;     }
00078     AP4_FtypAtom*       GetFileType()   { return m_FileType;  }
00079     AP4_Result          SetFileType(AP4_UI32     major_brand,
00080                                     AP4_UI32     minor_version,
00081                                     AP4_UI32*    compatible_brands = NULL,
00082                                     AP4_Cardinal compatible_brand_count = 0);
00083     virtual AP4_Result  Inspect(AP4_AtomInspector& inspector);
00084 
00085 private:
00086     // members
00087     AP4_Movie*         m_Movie;
00088     AP4_FtypAtom*      m_FileType;
00089     AP4_List<AP4_Atom> m_OtherAtoms;
00090 };
00091 
00092 #endif // _AP4_FILE_H_

Generated on Thu Mar 15 16:06:10 2007 for Bento4 MP4 SDK by  doxygen 1.5.1-p1