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

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

Definition at line 173 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().

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

Here is the call graph for this function:


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