MP7File Class Reference

<class description="" goes="" here=""> <short description=""> More...

#include <MP7File.hpp>

List of all members.


Static Public Member Functions

char * generateMP7Description (ContainerInfo *mp4Info, char *mp7File, bool showVisualResult=false)
 generates an MPEG-7 description for a locally stored ContainerInfo object.
bool setAdaptors (ContainerInfo *mp4Info, char *mp7File)
 sets the MetaItems (incl.
bool convertMetaInfoToMP7 (const ContainerInfo *mp4Info, char *mp7File)
 convert the Meta-Info stored in the mp4Info object to an MPEG-7 description.
FILE * openMP7File (const char *mp7File)
 opens a FILE and writes an MPEG-7 header to the file.
bool closeMP7File (FILE *fp)
 closes an mpeg-7 file, writes the closing header, returns false if fp is NULL
bool writeVariationSet (FILE *fp, Adaptor **adaptor, int numAdaptors, ContainerInfo *mp4Info, bool showVisualResult=false)
 writes a variationset entry to a file, applies all Adaptors specified in

Static Protected Attributes

const char *const NL = "\r\n"
const char *const content = "Content"
const char *const name = "Name"
const char *const fileFormat = "FileFormat"
const char *const variationSet = "VariationSet"
const char *const fileSize = "FileSize"
const char *const mediaProfile = "MediaProfile"
const char *const componentMediaProfile = "ComponentMediaProfile"
const char *const bitRate = "BitRate"
const char *const mediaLocator = "MediaLocator"
const char *const preHeader
const char *const closeHeader = "\t</Description>%s</Mpeg7>%s"

Detailed Description

<class description="" goes="" here=""> <short description="">

Author:
Michael Kropfberger and Peter Schojer
Version:
Id
MP7File.hpp,v 1.5 2004/03/25 13:38:17 mkropfbe Exp

Definition at line 72 of file MP7File.hpp.


Member Function Documentation

bool MP7File::convertMetaInfoToMP7 const ContainerInfo mp4Info,
char *  mp7File
[static]
 

convert the Meta-Info stored in the mp4Info object to an MPEG-7 description.

Already applied adaptors will be exclude form the MPEG-7 description.Definition at line 259 of file MP7File.cpp.

00261 { 00262 return false; 00263 };

char * MP7File::generateMP7Description ContainerInfo mp4Info,
char *  mp7File,
bool  showVisualResult = false
[static]
 

generates an MPEG-7 description for a locally stored ContainerInfo object.

This method will apply different Adaptors to the video and use this information to generate the mp7file. Note: this method can take very long. In case of an error NULL is returned, otherwise the name of the generated MPEG-7 fileDefinition at line 88 of file MP7File.cpp.

References ContainerInfo::clone(), closeMP7File(), ContainerDemux::demultiplexAndUpdateIO(), ContainerInfo::getFirstVisualES(), openMP7File(), and writeVariationSet().

00090 { 00091 00092 FILE *fp = MP7File::openMP7File(mp7File); 00093 if (!fp) 00094 return NULL; 00095 00097 ContainerDemux::demultiplexAndUpdateIO(mp4Info,"."); 00098 00099 ContainerInfo *clone = mp4Info->clone(); 00100 VideoESInfo *esi = clone->getFirstVisualES(); 00101 unsigned int w = esi->getWidth() / 2; 00102 unsigned int h = esi->getHeight() / 2; 00103 Adaptor **adaptors = new Adaptor *[3]; 00104 adaptors[0] = new Forwarder(); 00105 adaptors[1] = new TemporalAdaptor(); 00106 adaptors[2] = new StrongTemporalAdaptor(); 00107 MP7File::writeVariationSet(fp, adaptors, 3, clone, showVisualResult); 00108 delete clone; 00109 delete adaptors[0]; 00110 delete adaptors[1]; 00111 delete adaptors[2]; 00112 delete adaptors; 00113 00114 clone = mp4Info->clone(); 00115 esi = clone->getFirstVisualES(); 00116 adaptors = new Adaptor *[1]; 00117 adaptors[0] = 00118 new SpatialReductionAdaptor(esi, &w, &h, 00119 esi->getAvgBandwidth() / 4); 00120 MP7File::writeVariationSet(fp, adaptors, 1, clone, showVisualResult); 00121 delete clone; 00122 delete adaptors[0]; 00123 delete adaptors; 00124 00125 00126 MP7File::closeMP7File(fp); 00127 00128 return mp7File; 00129 };

FILE * MP7File::openMP7File const char *  mp7File  )  [static]
 

opens a FILE and writes an MPEG-7 header to the file.

In case of an error NULL is returne, otherwise the file pointerDefinition at line 132 of file MP7File.cpp.

Referenced by generateMP7Description().

00133 { 00134 FILE *fp = fopen(mp7File, "wb"); 00135 if (!fp) 00136 return NULL; 00137 fprintf(fp, preHeader, NL, NL, NL); 00138 return fp; 00139 };

bool MP7File::setAdaptors ContainerInfo mp4Info,
char *  mp7File
[static]
 

sets the MetaItems (incl.

Adaptors) in the QualityInfo object of the ContainerInfo object by parsing the mp7File. The .mp7 file must be in ASCII format, BIM is not supported. If sth. went wrong false is returned, otherwise true.Definition at line 250 of file MP7File.cpp.

00251 { 00252 return false; 00253 };

bool MP7File::writeVariationSet FILE *  fp,
Adaptor **  adaptor,
int  numAdaptors,
ContainerInfo mp4Info,
bool  showVisualResult = false
[static]
 

writes a variationset entry to a file, applies all Adaptors specified in

Parameters:
adaptor to the mp4Info object, which is not modified!
showVisualResults creates a Renderer that displays adaptation results.
Definition at line 151 of file MP7File.cpp.

References ContainerDemux::demultiplexAndUpdateIO().

Referenced by generateMP7Description().

00154 { 00155 MP7File::writeEntry(fp, 2, variationSet, false); 00156 MP7File::writeEntry(fp, 3, "Source xsi:type=\"VideoType\"", false); 00157 MP7File::writeEntry(fp, 4, "Video id=\"SourceVideo\"", false); 00158 MP7File::writeMediaInformation(fp, 5,mp4Info); 00159 MP7File::writeEntry(fp, 4, "Video", true); 00160 MP7File::writeEntry(fp, 3, "Source", true); 00161 char *adaptorName = new char[MAX_STR_LEN]; 00162 dprintf_full("MP7File::writeVariationSet Doing %i adaptations\r\n",numAdaptors); 00163 // description of the video is finished 00164 // now do the Variation description 00165 float fidelity = 1.0; // FIXME: calculate fidelity 00166 for (int i = 0; i < numAdaptors; i++) { 00167 strcpy(adaptorName,adaptors[i]->getName()); 00168 dprintf_full("MP7File::writeVariationSet Doing %s\r\n", adaptors[i]->getName()); 00169 if (showVisualResult) { 00170 ContainerDemux::demultiplexAndUpdateIO(mp4Info, ".", adaptors[i], false, 00171 false, true); 00172 } else 00173 ContainerDemux::demultiplexAndUpdateIO(mp4Info, ".", adaptors[i], false, 00174 false, false); 00175 00176 fidelity -= (float) (1.0 / (numAdaptors + 1)); // FIXME 00177 MP7File::writeAdaptation(fp, 3, mp4Info, adaptorName, i + 1, i + 1, 00178 fidelity); 00179 } 00180 00181 MP7File::writeEntry(fp, 2, variationSet, true); 00182 00183 delete [] adaptorName; 00184 return true; 00185 };


Member Data Documentation

const char *const MP7File::preHeader [static, protected]
 

Initial value:

"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>%s<Mpeg7 xmlns=\"urn:mpeg:mpeg7:schema:2001\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:mpeg7=\"urn:mpeg:mpeg7:schema:2001\" xsi:schemaLocation=\"urn:mpeg:mpeg7:schema:2001 definitions2.xsd\">%s\t<Description xsi:type=\"VariationDescriptionType\">%s"
Definition at line 77 of file MP7File.cpp.

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