# AP4_File Class Reference

The AP4_File object is the top level object for MP4 Files. More...

`#include <Ap4File.h>`

Inheritance diagram for AP4_File:

List of all members.

## Public Member Functions
| AP4_File (AP4_Movie *movie=NULL)
| Constructs an AP4_File from an AP4_Movie (used for writing).
| AP4_File (AP4_ByteStream &stream, AP4_AtomFactory &atom_factory=AP4_DefaultAtomFactory::Instance, bool moov_only=false)
| Constructs an AP4_File from a stream.
virtual | ~AP4_File ()
| Destroys the AP4_File instance.
AP4_List< AP4_Atom > & | GetOtherAtoms ()
| Get the top level atoms of the file (except ftyp and mdat atoms).
AP4_Movie * | GetMovie ()
| Get the AP4_Movie object of this file.
AP4_FtypAtom * | GetFileType ()
| Get the file type atom of this file.
AP4_Result | SetFileType (AP4_UI32 major_brand, AP4_UI32 minor_version, AP4_UI32 *compatible_brands=NULL, AP4_Cardinal compatible_brand_count=0)
| Set the file type.
bool | IsMoovBeforeMdat () const
| Ask whether the moov atom appears before the first mdat atom.
const AP4_MetaData * | GetMetaData ()
| Get the file's metadata description.
virtual AP4_Result | Inspect (AP4_AtomInspector &inspector)
| Inspect the content of the file with an AP4_AtomInspector.

## Detailed Description

The AP4_File object is the top level object for MP4 Files.

Definition at line 74 of file Ap4File.h.

## Constructor & Destructor Documentation

AP4_File::AP4_File | ( | AP4_Movie * | movie = `NULL` | ) |

Constructs an AP4_File from an AP4_Movie (used for writing).

Parameters:

  | movie | the movie

AP4_File::AP4_File | ( | AP4_ByteStream & | stream,
|  | AP4_AtomFactory & | atom_factory = `AP4_DefaultAtomFactory::Instance`,
|  | bool | moov_only = `false` |
| ) |  |  |

Constructs an AP4_File from a stream.

Parameters:

  | stream | the stream containing the data of the file
  | factory | the atom factory that will be used to parse the stream
  | moov_only | indicates whether parsing of the atoms should stop when the moov atom is found or if all atoms should be parsed until the end of the file.

virtual AP4_File::~AP4_File | ( |  | ) | `[virtual]`

Destroys the AP4_File instance.

## Member Function Documentation

AP4_List<AP4_Atom>& AP4_File::GetOtherAtoms | ( |  | ) | `[inline]`

Get the top level atoms of the file (except ftyp and mdat atoms).

Definition at line 103 of file Ap4File.h.

References AP4_AtomParent::m_Children.

AP4_Movie* AP4_File::GetMovie | ( |  | ) | `[inline]`

Get the AP4_Movie object of this file.

Definition at line 108 of file Ap4File.h.

AP4_FtypAtom* AP4_File::GetFileType | ( |  | ) | `[inline]`

Get the file type atom of this file.

Definition at line 114 of file Ap4File.h.

AP4_Result AP4_File::SetFileType | ( | AP4_UI32 | major_brand,
|  | AP4_UI32 | minor_version,
|  | AP4_UI32 * | compatible_brands = `NULL`,
|  | AP4_Cardinal | compatible_brand_count = `0` |
| ) |  |  |

Set the file type.

Will internally create an AP4_Ftyp atom and attach it to the file

bool AP4_File::IsMoovBeforeMdat | ( |  | ) | const`[inline]`

Ask whether the moov atom appears before the first mdat atom.

Definition at line 128 of file Ap4File.h.

const AP4_MetaData* AP4_File::GetMetaData | ( |  | ) |

Get the file's metadata description.

virtual AP4_Result AP4_File::Inspect | ( | AP4_AtomInspector & | inspector | ) | `[virtual]`

Inspect the content of the file with an AP4_AtomInspector.

The documentation for this class was generated from the following file:

- Ap4File.h