gchar *fullpath = g_build_path ("/", _tmpdir, _dirname, NULL);
gchar *dir = g_mkdtemp ((gchar *) fullpath);
gchar *file1 = g_build_path ("/", dir, "valve1", NULL);
+ uint8_t *content = NULL;
+ gsize len = 0;
+
gchar * pipeline =
g_strdup_printf
- ("videotestsrc is-live=true ! videoconvert ! videoscale ! video/x-raw,format=RGBx,width=16,height=16,framerate=10/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=10/1 ! tensor_converter ! queue ! valve name=valve1 ! filesink location=\"%s\" buffer-mode=unbuffered",
file1);
- GStatBuf buf;
ml_pipeline_h handle;
ml_pipeline_state_e state;
status = ml_pipeline_stop (handle);
assert_eq (status, ML_ERROR_NONE);
- status = g_lstat (file1, &buf);
- assert_eq (status, 0);
- assert_eq (buf.st_size, 0);
-
status = ml_pipeline_start (handle);
assert_eq (status, ML_ERROR_NONE);
status = ml_pipeline_destroy (handle);
assert_eq (status, ML_ERROR_NONE);
- status = g_lstat (file1, &buf);
- assert_eq (status, 0);
- assert_geq (buf.st_size, 2048); /* At least two frames during SLEEP_TIME */
- assert_eq (buf.st_size % 1024, 0); /* It should be divided by 1024 */
+ assert_eq (g_file_get_contents (file1, (gchar **) &content, &len, NULL), TRUE);
+ assert_geq (len, 1024);
+ g_free (content);
g_free (fullpath);
g_free (file1);