torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BitstreamExample.cpp File Reference

Example program to open a device bitstream and display its packets. More...

#include "torc/Bitstream.hpp"
#include "torc/Common.hpp"
#include <fstream>
#include <iostream>
+ Include dependency graph for BitstreamExample.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to open a device bitstream and display its packets.

Definition in file BitstreamExample.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 27 of file BitstreamExample.cpp.

27  {
28 
29  // we need an input bitstream
30  if(argc != 2) {
31  std::cout << "Usage: " << argv[0] << " bitstream.bit" << std::endl;
32  exit(-1);
33  }
34 
35  // read the bitstream
36  boost::filesystem::path bitstreamPath = argv[1];
37  BitstreamSharedPtr bitstreamPtr = Factory::newBitstreamPtr(bitstreamPath);
38  // write the bitstream digest to the console
39  std::cout << *bitstreamPtr << std::endl;
40 
41  return 0;
42 }
boost::filesystem::path path
boost::shared_ptr< Bitstream > BitstreamSharedPtr