fix(samples): check sample enable code

This commit is contained in:
TinyOh 2019-03-02 08:22:04 +08:00
parent 3b22fa3abc
commit 96a1b2a62d
8 changed files with 15 additions and 2 deletions

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -25,6 +25,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
bool ok;
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
api->ConfigStreamRequest(request);
Model model = api->GetModel();

View File

@ -28,6 +28,8 @@ int main(int argc, char *argv[]) {
auto &&request = api->SelectStreamRequest(&ok);
if (!ok) return 1;
api->ConfigStreamRequest(request);
api->EnableStreamData(Stream::LEFT);
api->EnableStreamData(Stream::RIGHT);
// Enable this will cache the motion datas until you get them.
api->EnableMotionDatas();

View File

@ -238,8 +238,7 @@ void Synthetic::DisableStreamData(const Stream &stream) {
bool Synthetic::IsStreamDataEnabled(const Stream &stream) const {
if (checkControlDateWithStream(stream)) {
auto data = getControlDateWithStream(stream);
return data.enabled_mode_ == MODE_SYNTHETIC ||
data.enabled_mode_ == MODE_NATIVE;
return data.enabled_mode_ == MODE_SYNTHETIC;
}
return false;
}