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

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

Definition at line 578 of file VideoAccessObject.h.

References ILOG_DEBUG, ILOG_ERROR, mFormatCtx, and mSrcAddress.

Referenced by VideoAccessObject().

00579     {
00580         int result = av_open_input_file(&mFormatCtx, 
00581                                  mSrcAddress.c_str(), NULL, 0, NULL);
00582 
00583         if (result != 0)
00584         {
00585             ILOG_ERROR("Unable to open: " << mSrcAddress << 
00586                 " (" << result << ")");
00587             return false;
00588         }
00589 
00590 #if LIBAVFORMAT_VERSION_INT >= ((51<<16)+(14<<8)+0) // from version 51.14.0 on
00591         if (mFormatCtx->iformat->flags & AVFMT_GENERIC_INDEX)
00592         {
00593             // if flag not initially cleared, may result in invalid data;
00594             // mFormatCtx is not available until input file is opened
00595             mFormatCtx->iformat->flags -= AVFMT_GENERIC_INDEX;
00596             ILOG_DEBUG("Flag cleared: mFormatCtx->iformat->flags -= " <<
00597                 "AVFMT_GENERIC_INDEX");
00598 
00599             // re-open the file
00600             result = av_open_input_file(&mFormatCtx, 
00601                                  mSrcAddress.c_str(), NULL, 0, NULL);
00602         }
00603 #endif
00604 
00605         // Retrieve stream information
00606         result = av_find_stream_info(mFormatCtx);
00607         if (result < 0) 
00608         {
00609             ILOG_ERROR("Could not find stream info in: " << mSrcAddress <<
00610                 " (" << result << ")");
00611             return false;
00612         }
00613 
00614         // Dump information about file onto standard error
00615         dump_format(mFormatCtx, 0, mSrcAddress.c_str(), false);
00616 
00617         mFormatCtx->flags |= AVFMT_FLAG_GENPTS;
00618 
00619         return true;
00620     }


Generated on Fri Mar 19 11:18:41 2010 for ImpalaSrc by  doxygen 1.5.1