summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/gstreamer/gstreamer_multi_stream_test.cpp3
-rw-r--r--test/gstreamer/gstreamer_test.cpp6
-rw-r--r--test/gstreamer/gstreamer_test.h3
3 files changed, 6 insertions, 6 deletions
diff --git a/test/gstreamer/gstreamer_multi_stream_test.cpp b/test/gstreamer/gstreamer_multi_stream_test.cpp
index b8387c10..cd669308 100644
--- a/test/gstreamer/gstreamer_multi_stream_test.cpp
+++ b/test/gstreamer/gstreamer_multi_stream_test.cpp
@@ -70,8 +70,6 @@ protected:
int run() override
{
- g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), NULL);
-
/* Build the pipeline */
gst_bin_add_many(GST_BIN(pipeline_), libcameraSrc_,
stream0_, stream1_, NULL);
@@ -106,7 +104,6 @@ protected:
}
private:
- std::string cameraName_;
GstElement *stream0_;
GstElement *stream1_;
};
diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp
index 4947b7bb..fe8e8e15 100644
--- a/test/gstreamer/gstreamer_test.cpp
+++ b/test/gstreamer/gstreamer_test.cpp
@@ -73,7 +73,7 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)
* Atleast one camera should be available with numStreams streams,
* otherwise skip the test entirely.
*/
- if (!checkMinCameraStreams(numStreams)) {
+ if (!checkMinCameraStreamsAndSetCameraName(numStreams)) {
status_ = TestSkip;
return;
}
@@ -81,7 +81,7 @@ GstreamerTest::GstreamerTest(unsigned int numStreams)
status_ = TestPass;
}
-bool GstreamerTest::checkMinCameraStreams(unsigned int numStreams)
+bool GstreamerTest::checkMinCameraStreamsAndSetCameraName(unsigned int numStreams)
{
libcamera::CameraManager cm;
bool cameraFound = false;
@@ -93,6 +93,7 @@ bool GstreamerTest::checkMinCameraStreams(unsigned int numStreams)
continue;
cameraFound = true;
+ cameraName_ = camera->id();
break;
}
@@ -121,6 +122,7 @@ int GstreamerTest::createPipeline()
return TestFail;
}
+ g_object_set(libcameraSrc_, "camera-name", cameraName_.c_str(), NULL);
g_object_ref_sink(libcameraSrc_);
return TestPass;
diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h
index 6f277cc5..aa2261e2 100644
--- a/test/gstreamer/gstreamer_test.h
+++ b/test/gstreamer/gstreamer_test.h
@@ -24,10 +24,11 @@ protected:
int processEvent();
void printError(GstMessage *msg);
+ std::string cameraName_;
GstElement *pipeline_;
GstElement *libcameraSrc_;
int status_;
private:
- bool checkMinCameraStreams(unsigned int numStreams);
+ bool checkMinCameraStreamsAndSetCameraName(unsigned int numStreams);
};