本文整理汇总了C++中AP4_Atom::Inspect方法的典型用法代码示例。如果您正苦于以下问题:C++ AP4_Atom::Inspect方法的具体用法?C++ AP4_Atom::Inspect怎么用?C++ AP4_Atom::Inspect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AP4_Atom
的用法示例。
在下文中一共展示了AP4_Atom::Inspect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inspector
/*----------------------------------------------------------------------
| main
+---------------------------------------------------------------------*/
int
main(int argc, char** argv)
{
if (argc < 2) {
PrintUsageAndExit();
}
// init the variables
AP4_UI32 track_id = 0;
AP4_ByteStream* input = NULL;
AP4_ByteStream* track_data = NULL;
// parse the command line
argv++;
char* arg;
while ((arg = *argv++)) {
if (!strcmp(arg, "-track")) {
if (argv[0] && argv[1] && argv[2]) {
track_id = atoi(argv[0]);
if (track_id == 0) PrintUsageAndExit();
track_data =
new AP4_FileByteStream(argv[1],
AP4_FileByteStream::STREAM_MODE_WRITE);
argv += 2;
} else {
PrintUsageAndExit();
}
} else {
try {
input =
new AP4_FileByteStream(arg,
AP4_FileByteStream::STREAM_MODE_READ);
} catch(AP4_Exception e) {
AP4_Debug("ERROR: cannot open input (%d)\n", e.m_Error);
return 1;
}
}
}
// open the output
AP4_ByteStream* output =
new AP4_FileByteStream("-stdout",
AP4_FileByteStream::STREAM_MODE_WRITE);
// create an inspector
AP4_PrintInspector inspector(*output);
// inspect the atoms one by one
AP4_Atom* atom;
//for (int i=0; i<1000; i++) {
AP4_AtomFactory& atom_factory = AP4_AtomFactory::DefaultFactory;
//MyTypeHandler my_type_handler;
//atom_factory.AddTypeHandler(&my_type_handler);
while (atom_factory.CreateAtomFromStream(*input, atom) ==
AP4_SUCCESS) {
atom->Inspect(inspector);
delete atom;
}
//input->Seek(0);
//}
// inspect the track data if needed
if ((track_id != 0) && (track_data != NULL)) {
//DumpTrackData(file, track_id, track_data);
}
if (input) input->Release();
if (output) output->Release();
if (track_data) track_data->Release();
return 0;
}