unsigned long duration;
} test_util_s;
-static void display_sub_basic();
+test_util_s *_util_s;
+
+static void display_sub_basic();
+void _video_util_start_transcoding(test_util_s *util_s);
void _quit_program(void)
{
test_util_s *_util_s = (test_util_s *)user_data;
+ if (!_util_s) {
+ LOGE("completed_cb user data is NULL");
+ return;
+ }
+
LOGI("transcode_completed_cb============= [%2d / %2d][%d]\n", _util_s->idx, make_video_cnt, error);
printf("transcode_completed_cb============= [%2d / %2d][%d]\n", _util_s->idx, make_video_cnt, error);
if (_util_s->idx == (make_video_cnt - 1)) {
LOGI("End trascoding");
- video_util_destroy(_util_s->video_h);
- _util_s->video_h = NULL;
- video_h = NULL;
return;
}
_util_s->idx = idx;
_util_s->start_time = ntn_start_position;
- _video_util_start_transcoding((test_util_s *)_util_s);
+ _video_util_start_transcoding(_util_s);
return;
}
LOGE("video_util_start_transcoding is failed (%d)", ret);
return;
}
+
+ return;
}
void _reset_var()
static void input_filename(char *filename)
{
int len = strlen(filename);
- int i = 0;
int ret = VIDEO_UTIL_ERROR_NONE;
if (len < 0 || len > MAX_STRING_LEN) {
if (strncmp(cmd, "a", 1) == 0) {
g_menu_state = CURRENT_STATUS_FILENAME;
} else if (strncmp(cmd, "s", 1) == 0) {
+ if (!_util_s) {
+ _util_s = (test_util_s *)calloc(1, sizeof(test_util_s));
+ LOGE("_util_s malloc");
+ }
- test_util_s *_util_s = (test_util_s *)calloc(1, sizeof(test_util_s));
if (!_util_s) {
- g_print("test util calloc failed");
+ LOGE("test util calloc failed");
return;
}
g_menu_state = CURRENT_STATUS_SET_OUTFILENAME;
} else if (strncmp(cmd, "q", 1) == 0) {
_quit_program();
+ } else if (strncmp(cmd, "d", 1) == 0) {
+ int ret = VIDEO_UTIL_ERROR_NONE;
+ if (!video_h) {
+ g_print("video_util handle is NULL, please set format after create");
+ return;;
+ }
+ ret = video_util_destroy(video_h);
+ if (ret != VIDEO_UTIL_ERROR_NONE) {
+ g_print("video_util_cancel_transcoding is failed (%d)", ret);
+ return;
+ }
+ free(_util_s);
+ _util_s = NULL;
} else {
g_print("unknown menu \n");
}
}
case CURRENT_STATUS_SET_TIME:
{
- int ret = VIDEO_UTIL_ERROR_NONE;
int value = atoi(cmd);
static int set_time_cnt = 0;
g_print("vf. Set video fps\n");
g_print(" t. Set start/duration time \t");
g_print(" o. Set output filename\t");
- g_print(" q. quite test suite\t");
+ g_print(" q. quite test suite\t\n");
+ g_print(" d. Destroy\t");
g_print("\n");
g_print("=========================================================================================\n");
}