MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / SetSource

Method SetSource

Source/OpenNI/XnPlayerImpl.cpp:130–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130XnStatus PlayerImpl::SetSource(XnRecordMedium sourceType, const XnChar* strSource)
131{
132 XnStatus nRetVal = XN_STATUS_OK;
133
134 // NOTE: we don't want playback speed to affect getting to the first frame, so perform this
135 // without playback speed
136 XnDouble dPlaybackSpeed = GetPlaybackSpeed();
137 SetPlaybackSpeed(XN_PLAYBACK_SPEED_FASTEST);
138
139 //Right now the only record medium we support is a file
140
141 m_sourceType = sourceType;
142
143 switch (m_sourceType)
144 {
145 case XN_RECORD_MEDIUM_FILE:
146 {
147 nRetVal = xnOSStrCopy(m_strSource, strSource, sizeof(m_strSource));
148 XN_IS_STATUS_OK(nRetVal);
149 nRetVal = ModulePlayer().SetInputStream(ModuleHandle(), this, &s_fileInputStream);
150 XN_IS_STATUS_OK(nRetVal);
151 break;
152 }
153 default:
154 XN_ASSERT(FALSE);
155 return XN_STATUS_BAD_PARAM;
156 }
157
158 // now re-set playback speed
159 nRetVal = SetPlaybackSpeed(dPlaybackSpeed);
160 XN_IS_STATUS_OK(nRetVal);
161
162 return XN_STATUS_OK;
163}
164
165XnStatus PlayerImpl::GetSource(XnRecordMedium &sourceType, XnChar* strSource, XnUInt32 nBufSize)
166{

Callers 1

xnSetPlayerSourceFunction · 0.45

Calls 3

ModulePlayerClass · 0.85
SetInputStreamMethod · 0.80
xnOSStrCopyFunction · 0.50

Tested by

no test coverage detected