Source: tdtfmediareader.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                    Master Thesis Implementation                  ####
// ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
// ####                  DiffServ with A Priori Knowledge                ####
// ####                                                                  ####
// #### ================================================================ ####
// ####                                                                  ####
// ####                                                                  ####
// #### TDTF Media Reader                                                ####
// ####                                                                  ####
// #### Version 1.00  --  October 10, 2000                               ####
// ####                                                                  ####
// #### Copyright (C) 2000 Thomas Dreibholz                              ####
// #### University of Bonn, Department of Computer Science IV            ####
// #### EMail: Dreibholz@bigfoot.com                                     ####
// #### WWW:   http://www.bigfoot.com/~dreibholz/diplom/index.html       ####
// ####                                                                  ####
// ##########################################################################


#ifndef TDTFMEDIAREADER_H
#define TDTFMEDIAREADER_H


#include "system.h"
#include "tdtfreader.h"
#include "mediainfo.h"


namespace Coral {


/**
  * This class is a media reader for TDTF trace files.
  *
  * @short   TDTF Media Reader.
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class TDTFMediaReader : public TDTFReader
{
   public:
   // ====== Constructor ====================================================
   /**
     * Constructor.
     */
   TDTFMediaReader();


   // ====== Open/close media ===============================================
   /**
     * Open media.
     *
     * @param name Name of media, e.g. a file name.
     * @param readWrite true to open file in read/write mode; false for read-only.
     * @param ruRequired true, if file has to contain resource/utilization list for successful opening; false otherwise.
     * @return true, if TDTFMediaReader is ready for reading; false otherwise.
     */
   bool open(const char* name,
             const bool  readWrite  = false,
             const bool  ruRequired = false);

   /**
     * Close media, if opened.
     */
   void close();


   // ====== Status functions ===============================================
   /**
     * Check, if TDTFMediaReader is ready for reading.
     *
     * @return true, if TDTFMediaReader is ready; false otherwise.
     */
   inline bool ready() const;

   /**
     * Get MediaInfo.
     *
     * @param mediaInfo Reference to store media info.
     */
   void getMediaInfo(MediaInfo& mediaInfo) const;

   /**
     * Get error code.
     *
     * @return Error code.
     */
   inline MediaError getErrorCode() const;

   /**
     * Get current position.
     *
     * @return Position in nanoseconds.
     */
   inline card64 getPosition() const;

   /**
     * Get maximum position.
     *
     * @return maximum position in nanoseconds.
     */
   inline card64 getMaxPosition() const;

   /**
     * Get position.
     *
     * @param position Position in nanoseconds.
     */
   inline void setPosition(const card64 position);

   /**
     * Get frame rate.
     *
     * @return Frame rate.
     */
   inline double getFrameRate() const;

   /**
     * Set frame rate.
     *
     * @param frameRate Frame rate.
     * @return Frame rate set.
     */
   inline double setFrameRate(const double frameRate);


   // ====== Read next frame trace ==========================================
   /**
     * Check, if new interval is reached.
     *
?????????????????????????????????
     * @return true, if new interval is reached.
     */
   card64 checkInterval();

   /**
     * Read next frame trace block.
     *
     * @param layers Maximum number of layers to store in arrays.
     * @param frameIDArray Pointer to array to store frame-IDs.
     * @param frameSizeArray Pointer to array to store frame sizes.
     * @param newInterval Reference to boolean to store true, if new interval is reached; false otherwise.
     * @return cardinal Number of layers read.
     */
   cardinal getNextBlock(const cardinal layers,
                         cardinal*      frameIDArray,
                         cardinal*      frameSizeArray);


   // ====== Private data ===================================================
   private:
   const IntervalHeader* Interval;
   card64                Position;
   card64                MaxPosition;
   double                FrameRate;
   MediaError            ErrorCode;
};


}


#include "tdtfmediareader.icc"


#endif

Generated by: viper@odin on Mon Oct 16 11:49:26 2000, using kdoc 2.0a36.