Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

bool Impala::Core::Stream::Lavc::VideoAccessObject::InitFormatContext (  )  [inline, private]

Definition at line 640 of file VideoAccessObject.h.

References ILOG_DEBUG, ILOG_ERROR, mFormatCtx, and mSrcAddress.

Referenced by VideoAccessObject().

00641     {
00642         int result = av_open_input_file(&mFormatCtx, 
00643                                  mSrcAddress.c_str(), NULL, 0, NULL);
00644 
00645         if (result != 0)
00646         {
00647             ILOG_ERROR("Unable to open: " << mSrcAddress << 
00648                 " (" << result << ")");
00649             return false;
00650         }
00651 
00652 #if LIBAVFORMAT_VERSION_INT >= ((51<<16)+(14<<8)+0) // from version 51.14.0 on
00653         if (mFormatCtx->iformat->flags & AVFMT_GENERIC_INDEX)
00654         {
00655             // if flag not initially cleared, may result in invalid data;
00656             // mFormatCtx is not available until input file is opened
00657             mFormatCtx->iformat->flags -= AVFMT_GENERIC_INDEX;
00658             ILOG_DEBUG("Flag cleared: mFormatCtx->iformat->flags -= " <<
00659                 "AVFMT_GENERIC_INDEX");
00660 
00661             // re-open the file
00662             result = av_open_input_file(&mFormatCtx, 
00663                                  mSrcAddress.c_str(), NULL, 0, NULL);
00664         }
00665 #endif
00666 
00667         // Retrieve stream information
00668         result = av_find_stream_info(mFormatCtx);
00669         if (result < 0) 
00670         {
00671             ILOG_ERROR("Could not find stream info in: " << mSrcAddress <<
00672                 " (" << result << ")");
00673             return false;
00674         }
00675 
00676         // Dump information about file onto standard error
00677         dump_format(mFormatCtx, 0, mSrcAddress.c_str(), false);
00678 
00679         mFormatCtx->flags |= AVFMT_FLAG_GENPTS;
00680 
00681         return true;
00682     }


Generated on Thu Jan 13 09:20:38 2011 for ImpalaSrc by  doxygen 1.5.1