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

void Impala::Core::Stream::RgbDataSrcLavc::Init (  )  [inline, private]

Definition at line 155 of file RgbDataSrcLavc.h.

References Impala::Core::Stream::Lavc::VideoAccessStrategyFactory::Construct(), Impala::CmdOptions::GetBool(), Impala::CmdOptions::GetInstance(), Impala::Persistency::Locator::GetProtocol(), Impala::CmdOptions::GetString(), ILOG_DEBUG, ILOG_ERROR, IncurExtraLavcInitialization(), InitStaticMetadata(), Impala::Core::Stream::RgbDataSrc::LastFrame(), Impala::Core::Stream::RgbDataSrc::mData, Impala::Core::Stream::RgbDataSrc::mLastFrame, mLoc, mMode, Impala::Core::Stream::RgbDataSrc::mSrcName, mValid, mVideoAccessor, Impala::Core::Stream::Lavc::VideoAccessStrategy::NrOfFrames(), PopulateIndex(), ReadIndex(), Reset(), Impala::Core::Stream::Lavc::VideoAccessStrategy::RgbDataPtr(), Scan(), and Impala::Core::Stream::RgbDataSrcInfo::WriteInfo().

Referenced by RgbDataSrcLavc().

00156     {
00157         CmdOptions& options = CmdOptions::GetInstance();
00158 #ifndef REPOSITORY_USED // Here comes the deprecated stuff
00159         String dataServer = options.GetString("dataServer");
00160 #else // REPOSITORY_USED
00161         String dataServer = (mLoc.GetProtocol() == "dataServer") ? "dataserver"
00162                                                                  : "";
00163 #endif // REPOSITORY_USED
00164         const String dataSrcAddress =
00165             dataServer.empty() ? mSrcName : "dataserver:" + mSrcName;
00166         Lavc::VideoAccessStrategyFactory factory;
00167         mVideoAccessor = factory.Construct(dataSrcAddress);
00168         if (mVideoAccessor == 0)
00169         {
00170             mValid = false;
00171             return;
00172         }
00173 
00174         if (mVideoAccessor->NrOfFrames() >= 0)
00175             mLastFrame = mVideoAccessor->NrOfFrames() - 1;
00176 
00177         InitStaticMetadata(*mVideoAccessor);
00178 
00179         mData = mVideoAccessor->RgbDataPtr();
00180 
00181         if (mMode == SCANONLY)
00182         {
00183             if (!Scan(*mVideoAccessor))
00184                 return;
00185         }
00186         else if (mMode == READIDX)
00187         {
00188             int nrOfFramesNow = -1;
00189             bool checkFrameCount = options.GetBool("checkstoredframecount", false);
00190             if (checkFrameCount)
00191             {
00192                 if (!Scan(*mVideoAccessor))
00193                     return;
00194                 nrOfFramesNow = mVideoAccessor->NrOfFrames();
00195             }
00196 
00197             if (ReadIndex(false))
00198             {
00199                 if (!IncurExtraLavcInitialization())
00200                     return;
00201                 if (checkFrameCount && (nrOfFramesNow != (LastFrame() + 1)))
00202                 {
00203                     ILOG_ERROR("Freshly established frame count (" << 
00204                         nrOfFramesNow << ") different " <<
00205                         "from stored frame count (" << LastFrame() + 1 << 
00206                         ") for: " << mSrcName);
00207                     return;
00208                 }
00209             }
00210             else
00211             {
00212                 ILOG_ERROR("Failed while reading index info for: " << 
00213                     mSrcName);
00214                 return;
00215             }
00216         }
00217         else if (mMode == WITHIDX)
00218         {
00219             if (ReadIndex(true))
00220             {
00221                 if (!IncurExtraLavcInitialization())
00222                     return;
00223             }
00224             else
00225             {
00226                 if (!PopulateIndex(*mVideoAccessor))
00227                     return;
00228             }
00229         }
00230         else if (mMode == ADHOCIDX)
00231         {
00232             if (!PopulateIndex(*mVideoAccessor))
00233                 return;
00234         }
00235         else if (mMode == WRITEIDX)
00236         {
00237             if (!PopulateIndex(*mVideoAccessor))
00238                 return;
00239             WriteInfo();
00240         }
00241 
00242         Reset();
00243         mValid = true;
00244         ILOG_DEBUG("Initialization succeeded");
00245     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:17:39 2010 for ImpalaSrc by  doxygen 1.5.1