{
ml_pipeline *p = pipe;
GstStateChangeReturn scret;
- GstState state, pending;
+ GstState state;
if (p == NULL)
return ML_ERROR_INVALID_PARAMETER;
g_mutex_lock (&p->lock);
/* if it's PLAYING, PAUSE it. */
- scret = gst_element_get_state (p->element, &state, &pending, 10000000UL); /* 10ms */
+ scret = gst_element_get_state (p->element, &state, NULL, 10 * GST_MSECOND); /* 10ms */
if (scret != GST_STATE_CHANGE_FAILURE && state == GST_STATE_PLAYING) {
/* Pause the pipeline if it's Playing */
scret = gst_element_set_state (p->element, GST_STATE_PAUSED);
{
ml_pipeline *p = pipe;
GstState _state;
- GstState pending;
GstStateChangeReturn scret;
if (p == NULL || state == NULL)
*state = ML_PIPELINE_STATE_UNKNOWN;
g_mutex_lock (&p->lock);
- scret = gst_element_get_state (p->element, &_state, &pending, 100000UL); /* Do it within 100us! */
+ scret = gst_element_get_state (p->element, &_state, NULL, GST_MSECOND); /* Do it within 1ms! */
g_mutex_unlock (&p->lock);
if (scret == GST_STATE_CHANGE_FAILURE)
*/
TEST (nnstreamer_capi_playstop, dummy_01)
{
- const char *pipeline = "videotestsrc is-live=true num-buffers=30 ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx";
+ const char *pipeline = "videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx";
ml_pipeline_h handle;
ml_pipeline_state_e state;
int status = ml_pipeline_construct (pipeline, &handle);
*/
TEST (nnstreamer_capi_playstop, dummy_02)
{
- const char *pipeline = "videotestsrc is-live=true num-buffers=30 ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx";
+ const char *pipeline = "videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=224,height=224,framerate=60/1 ! tensor_converter ! valve name=valvex ! valve name=valvey ! input-selector name=is01 ! tensor_sink name=sinkx";
ml_pipeline_h handle;
ml_pipeline_state_e state;
int status = ml_pipeline_construct (pipeline, &handle);
gchar *file1 = g_build_path ("/", dir, "valve1", NULL);
gchar *pipeline =
g_strdup_printf
- ("videotestsrc is-live=true num-buffers=20 ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=16,height=16,framerate=60/1 ! tensor_converter ! queue ! valve name=valve1 ! filesink location=\"%s\"",
+ ("videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=16,height=16,framerate=60/1 ! tensor_converter ! queue ! valve name=valve1 ! filesink location=\"%s\"",
file1);
GStatBuf buf;
status = ml_pipeline_valve_get_handle (handle, "valve1", &valve1);
EXPECT_EQ (status, ML_ERROR_NONE);
- status = ml_pipeline_start (handle);
+ status = ml_pipeline_valve_set_open (valve1, false); /* close */
EXPECT_EQ (status, ML_ERROR_NONE);
- status = ml_pipeline_valve_set_open (valve1, false); /* close */
+ status = ml_pipeline_start (handle);
EXPECT_EQ (status, ML_ERROR_NONE);
status = ml_pipeline_get_state (handle, &state);
status = ml_pipeline_valve_set_open (valve1, true); /* open */
EXPECT_EQ (status, ML_ERROR_NONE);
+
status = ml_pipeline_valve_put_handle (valve1); /* release valve handle */
EXPECT_EQ (status, ML_ERROR_NONE);