123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- /*
- * The contents of this file are subject to the Mozilla Public
- * License Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * rights and limitations under the License.
- *
- * The Original Code is MPEG4IP.
- *
- * The Initial Developer of the Original Code is Cisco Systems Inc.
- * Portions created by Cisco Systems Inc. are
- * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved.
- *
- * 3GPP features implementation is based on 3GPP's TS26.234-v5.60,
- * and was contributed by Ximpo Group Ltd.
- *
- * Portions created by Ximpo Group Ltd. are
- * Copyright (C) Ximpo Group Ltd. 2003, 2004. All Rights Reserved.
- *
- * Contributor(s):
- * Dave Mackie [email protected]
- * Ximpo Group Ltd. [email protected]
- * Bill May [email protected]
- */
- #ifndef __MP4_ATOMS_INCLUDED__
- #define __MP4_ATOMS_INCLUDED__
- // declare all the atom subclasses
- // i.e. spare us atom_xxxx.h for all the atoms
- //
- // The majority of atoms just need their own constructor declared
- // Some atoms have a few special needs
- // A small minority of atoms need lots of special handling
- class MP4RootAtom : public MP4Atom {
- public:
- MP4RootAtom();
- void BeginWrite(bool use64 = false);
- void Write();
- void FinishWrite(bool use64 = false);
- void BeginOptimalWrite();
- void FinishOptimalWrite();
- protected:
- u_int32_t GetLastMdatIndex();
- void WriteAtomType(const char* type, bool onlyOne);
- };
- /***********************************************************************
- * Common atom classes - standard for anything that just contains atoms
- * and non-maleable properties, treftype and url
- ***********************************************************************/
- class MP4StandardAtom : public MP4Atom {
- public:
- MP4StandardAtom(const char *name);
- };
- class MP4TrefTypeAtom : public MP4Atom {
- public:
- MP4TrefTypeAtom(const char* type);
- void Read();
- };
- class MP4UrlAtom : public MP4Atom {
- public:
- MP4UrlAtom(const char *type="url ");
- void Read();
- void Write();
- };
- /***********************************************************************
- * Sound and Video atoms - use the generic atoms when possible
- * (MP4SoundAtom and MP4VideoAtom)
- ***********************************************************************/
- class MP4SoundAtom : public MP4Atom {
- public:
- MP4SoundAtom(const char *atomid);
- void Generate();
- void Read();
- protected:
- void AddProperties(u_int8_t version);
- };
- class MP4VideoAtom : public MP4Atom {
- public:
- MP4VideoAtom(const char *atomid);
- void Generate();
- };
- class MP4AmrAtom : public MP4Atom {
- public:
- MP4AmrAtom(const char *type);
- void Generate();
- };
- // H.264 atoms
- class MP4Avc1Atom : public MP4Atom {
- public:
- MP4Avc1Atom();
- void Generate();
- };
- class MP4AvcCAtom : public MP4Atom {
- public:
- MP4AvcCAtom();
- void Generate();
- void Clone(MP4AvcCAtom *dstAtom);
- };
- class MP4D263Atom : public MP4Atom {
- public:
- MP4D263Atom();
- void Generate();
- void Write();
- };
-
- class MP4DamrAtom : public MP4Atom {
- public:
- MP4DamrAtom();
- void Generate();
- };
- class MP4EncaAtom : public MP4Atom {
- public:
- MP4EncaAtom();
- void Generate();
- };
- class MP4EncvAtom : public MP4Atom {
- public:
- MP4EncvAtom();
- void Generate();
- };
- class MP4Mp4aAtom : public MP4Atom {
- public:
- MP4Mp4aAtom();
- void Generate();
- };
- class MP4Mp4sAtom : public MP4Atom {
- public:
- MP4Mp4sAtom();
- void Generate();
- };
- class MP4Mp4vAtom : public MP4Atom {
- public:
- MP4Mp4vAtom();
- void Generate();
- };
- class MP4S263Atom : public MP4Atom {
- public:
- MP4S263Atom();
- void Generate();
- };
-
-
-
- /************************************************************************
- * Specialized Atoms
- ************************************************************************/
- class MP4DataAtom : public MP4Atom {
- public:
- MP4DataAtom();
- void Read();
- };
- class MP4DrefAtom : public MP4Atom {
- public:
- MP4DrefAtom();
- void Read();
- };
- class MP4ElstAtom : public MP4Atom {
- public:
- MP4ElstAtom();
- void Generate();
- void Read();
- protected:
- void AddProperties(u_int8_t version);
- };
- class MP4FreeAtom : public MP4Atom {
- public:
- MP4FreeAtom();
- void Read();
- void Write();
- };
- class MP4FtypAtom : public MP4Atom {
- public:
- MP4FtypAtom();
- void Generate();
- void Read();
- };
- class MP4GminAtom : public MP4Atom {
- public:
- MP4GminAtom();
- void Generate();
- };
- class MP4HdlrAtom : public MP4Atom {
- public:
- MP4HdlrAtom();
- void Read();
- };
- class MP4HinfAtom : public MP4Atom {
- public:
- MP4HinfAtom();
- void Generate();
- };
- class MP4HntiAtom : public MP4Atom {
- public:
- MP4HntiAtom();
- void Read();
- };
- class MP4MdatAtom : public MP4Atom {
- public:
- MP4MdatAtom();
- void Read();
- void Write();
- };
- class MP4MdhdAtom : public MP4Atom {
- public:
- MP4MdhdAtom();
- void Generate();
- void Read();
- protected:
- void AddProperties(u_int8_t version);
- };
- class MP4Meta1Atom : public MP4Atom {
- public:
- MP4Meta1Atom(const char *name);
- void Read();
- };
- class MP4Meta2Atom : public MP4Atom {
- public:
- MP4Meta2Atom(const char *name);
- void Read();
- };
- class MP4Meta3Atom : public MP4Atom {
- public:
- MP4Meta3Atom(const char *name);
- void Read();
- };
- class MP4Meta4Atom : public MP4Atom {
- public:
- MP4Meta4Atom(const char *name);
- void Read();
- };
-
- class MP4MvhdAtom : public MP4Atom {
- public:
- MP4MvhdAtom();
- void Generate();
- void Read();
- protected:
- void AddProperties(u_int8_t version);
- };
- class MP4OhdrAtom : public MP4Atom {
- public:
- MP4OhdrAtom();
- ~MP4OhdrAtom();
- void Read();
- };
- class MP4RtpAtom : public MP4Atom {
- public:
- MP4RtpAtom();
- void Generate();
- void Read();
- void Write();
- protected:
- void AddPropertiesStsdType();
- void AddPropertiesHntiType();
- void GenerateStsdType();
- void GenerateHntiType();
- void ReadStsdType();
- void ReadHntiType();
- void WriteHntiType();
- };
- class MP4SdpAtom : public MP4Atom {
- public:
- MP4SdpAtom();
- void Read();
- void Write();
- };
- class MP4SmiAtom : public MP4Atom {
- public:
- MP4SmiAtom(void);
- void Read();
- };
- class MP4StblAtom : public MP4Atom {
- public:
- MP4StblAtom();
- void Generate();
- };
- class MP4StdpAtom : public MP4Atom {
- public:
- MP4StdpAtom();
- void Read();
- };
- class MP4StscAtom : public MP4Atom {
- public:
- MP4StscAtom();
- void Read();
- };
- class MP4StsdAtom : public MP4Atom {
- public:
- MP4StsdAtom();
- void Read();
- };
- class MP4StszAtom : public MP4Atom {
- public:
- MP4StszAtom();
- void Read();
- void Write();
- };
- class MP4Stz2Atom : public MP4Atom {
- public:
- MP4Stz2Atom();
- void Read();
- };
- class MP4TextAtom : public MP4Atom {
- public:
- MP4TextAtom();
- void Generate();
- protected:
- void AddPropertiesStsdType();
- void AddPropertiesGmhdType();
- void GenerateStsdType();
- void GenerateGmhdType();
- };
- class MP4TfhdAtom : public MP4Atom {
- public:
- MP4TfhdAtom();
- void Read();
- protected:
- void AddProperties(u_int32_t flags);
- };
- class MP4TkhdAtom : public MP4Atom {
- public:
- MP4TkhdAtom();
- void Generate();
- void Read();
- protected:
- void AddProperties(u_int8_t version);
- };
- class MP4TrunAtom : public MP4Atom {
- public:
- MP4TrunAtom();
- void Read();
- protected:
- void AddProperties(u_int32_t flags);
- };
- class MP4UdtaAtom : public MP4Atom {
- public:
- MP4UdtaAtom();
- void Read();
- };
- class MP4UrnAtom : public MP4Atom {
- public:
- MP4UrnAtom();
- void Read();
- };
- class MP4VmhdAtom : public MP4Atom {
- public:
- MP4VmhdAtom();
- void Generate();
- };
- class MP4HrefAtom : public MP4Atom {
- public:
- MP4HrefAtom();
- void Generate(void);
- };
- class MP4ChplAtom : public MP4Atom {
- public:
- MP4ChplAtom();
- void Generate(void);
- };
- #endif /* __MP4_ATOMS_INCLUDED__ */
|