AnnodexRecomposer.h

Go to the documentation of this file.
00001 //===========================================================================
00002 //Copyright (C) 2005 Zentaro Kavanagh
00003 //Copyright (C) 2005 Commonwealth Scientific and Industrial Research
00004 //                   Organisation (CSIRO) Australia
00005 //
00006 //Redistribution and use in source and binary forms, with or without
00007 //modification, are permitted provided that the following conditions
00008 //are met:
00009 //
00010 //- Redistributions of source code must retain the above copyright
00011 //  notice, this list of conditions and the following disclaimer.
00012 //
00013 //- Redistributions in binary form must reproduce the above copyright
00014 //  notice, this list of conditions and the following disclaimer in the
00015 //  documentation and/or other materials provided with the distribution.
00016 //
00017 //- Neither the name of Zentaro Kavanagh nor the names of contributors 
00018 //  may be used to endorse or promote products derived from this software 
00019 //  without specific prior written permission.
00020 //
00021 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022 //``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023 //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00024 //PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
00025 //CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00026 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00027 //PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00028 //PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00029 //LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00030 //NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00031 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00032 //===========================================================================
00033 
00034 
00035 #pragma once
00036 
00037 
00038 #include "IRecomposer.h"
00039 
00040 #include <libOOOgg/libOOOgg.h>
00041 #include <libOOOggChef/libOOOggChef.h>
00042 
00043 #include <set>
00044 #include <string>
00045 #include <vector>
00046 
00047 using namespace std;
00048 
00049 class LIBOOOGGCHEF_API AnnodexRecomposer : public IRecomposer, public IOggCallback
00050 {
00051 public:
00052         AnnodexRecomposer(void);
00053         AnnodexRecomposer(string inFilename, BufferWriter inBufferWriter, void* inBufferWriterUserData, string inCachedSeekTableFilename = "");
00054         ~AnnodexRecomposer(void);
00055 
00056         bool recomposeStreamFrom(double inStartingTimeOffset, const vector<string>* inWantedMIMETypes);
00057         bool acceptOggPage(OggPage* inOggPage);
00058 
00059     AnnodexRecomposer(const AnnodexRecomposer&);  // Don't copy me
00060     AnnodexRecomposer &operator=(const AnnodexRecomposer&);  // Don't assign men
00061 
00062 protected:
00063 
00064         typedef pair<unsigned long, unsigned long> tSerial_HeadCountPair;
00065 
00066         enum eDemuxState {
00067                 SEEN_NOTHING,
00068                 SEEN_ANNODEX_BOS,
00069                 SEEN_ANNODEX_EOS,
00070                 SEEN_ALL_CODEC_HEADERS,
00071                 INVALID = 100,
00072         };
00073 
00074         enum eDemuxParserState {
00075                 LOOK_FOR_HEADERS,
00076                 LOOK_FOR_BODY,
00077         };
00078 
00079         BufferWriter mBufferWriter;
00080         void* mBufferWriterUserData;
00081 
00082         fstream mDebugFile;
00083 
00084         string mFilename;
00085         string mCachedSeekTableFilename;
00086 
00087         unsigned long mAnnodexSerialNumber;
00088 
00089         eDemuxState mDemuxState;
00090         eDemuxParserState mDemuxParserState;
00091 
00092         set<tSerial_HeadCountPair> mWantedStreamSerialNumbers;
00093         const vector<string>* mWantedMIMETypes;
00094 
00095         LOOG_UINT64 mRequestedStartTime;
00096 
00097         unsigned short mAnnodexMajorVersion;
00098 };

Generated on Tue Feb 15 14:54:22 2005 for oggdsf by  doxygen 1.3.9