diff --git a/README.md b/README.md index 4761fcf..793575d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,77 @@ # DJIPSDKVideoStreamCheckTool -PSDK video stream check tool, used to check whether the specified video stream conforms to the PSDK video stream standard - -Build Steps: -1. cd to stream_check_tool/project directory; -2. mkdir build directory; -3. cmake .. -4. make -5. build finished and executable stream_check_tool is in current directory. + +## Introduction +PSDK video stream check tool, used to check whether the specified video stream conforms to the PSDK video stream +standard. The tool support UDP transmission or file as input, and output check result. Please refer to +[DJI developer site](https://developer.dji.com/document/65de35b8-78ff-4199-b3ab-ce57ea95301b) for details of the PSDK +video steam standard. + +## Build Steps +1. `cd` to DJIPSDKVideoStreamCheckTool/project directory; +2. use `mkdir build` command to create a directory; +3. `cmake ..` +4. `make` + +## Usage +Please get help and usage by run `./stream_check_tool -h` command in Linux terminal. Just like + +```shell script +dji@manifold2:~/Documents/DJIPSDKVideoStreamCheckTool/project/build$ ./stream_check_tool -h + +stream_check_tool usage: +./stream_check_tool <-u [-p ] [-t ] |-f [-i ] [-t ] > [-h] [-v] + +-t type: Stream type, can be any value of "DJI-H264" or "Custom-H264" + +sample: +case 1: video stream received by UDP transmission channel as input, and please ensure every frame end with AUD (0x00 0x00 0x00 0x01 0x09 0x10) + stream_check_tool -u -p udp_port -t stream_type + udp_port is the UDP port which send video stream to, and the default value is 45654 + +case 2: video file as input + stream_check_tool -f -i filename -t stream_type +``` + +#### Video File as Input +Use below command to check local video file, and you will get output as below. + +```shell script +dji@manifold2:~/Documents/DJIPSDKVideoStreamCheckTool/project/build$ ./stream_check_tool -f -i test.h264 -t DJI-H264 + +[Passed] 0.stream size(reference 7.3.2.1.1) +[Passed] 1.profile_idc (reference 7.3.2.1.1) +[Passed] 2.level_idc (reference 7.3.2.1.1) +[Passed] 3.YUV420 chroma_format_idc (reference 7.3.2.1.1) +[Passed] 4.chroma and luma only allow 8 bit (reference 7.3.2.1.1) +[Passed] 5.seq_scaling_matrix_presenst_flag (reference 7.3.2.1.1 and 7.3.2.2) +[Passed] 6.frame_mbs_only_flag (reference 7.3.2.1.1) +[Passed] 7.slice_type (reference 7.3.3) +[Passed] 8.num_slice_groups_minus1 (reference 7.3.2.2) +[Passed] 9.max_num_ref_frames (reference 7.3.2.1.1) +[Passed] 10.video resolution (reference 7.3.2.1.1) + +[Passed] Currently, all frames has passed the above standards test. +``` + +#### UDP Transmission as Input +Ensure that the destination address of the video stream is 127.0.0.1 and the port can be customized such as 23003. +Use below command to check video stream from UDP transmission, and you will get output as below. + +```shell script +dji@manifold2:~/Documents/DJIPSDKVideoStreamCheckTool/project/build$ ./stream_check_tool -u -p 23003 -t DJI-H264 +udp reader mode, port 23003 + +[Passed] 0.stream size(reference 7.3.2.1.1) +[Passed] 1.profile_idc (reference 7.3.2.1.1) +[Passed] 2.level_idc (reference 7.3.2.1.1) +[Passed] 3.YUV420 chroma_format_idc (reference 7.3.2.1.1) +[Passed] 4.chroma and luma only allow 8 bit (reference 7.3.2.1.1) +[Passed] 5.seq_scaling_matrix_presenst_flag (reference 7.3.2.1.1 and 7.3.2.2) +[Passed] 6.frame_mbs_only_flag (reference 7.3.2.1.1) +[Passed] 7.slice_type (reference 7.3.3) +[Passed] 8.num_slice_groups_minus1 (reference 7.3.2.2) +[Passed] 9.max_num_ref_frames (reference 7.3.2.1.1) +[Passed] 10.video resolution (reference 7.3.2.1.1) + +[Passed] Currently, all frames has passed the above standards test. +``` diff --git a/application/Makefile b/application/Makefile index a82b849..db49286 100644 --- a/application/Makefile +++ b/application/Makefile @@ -17,7 +17,7 @@ ifeq (,$(shell mkdir -p $(BIN_PATH) $(OBJ_PATH) $(SRC_PATH) $(DBG_PATH))) endif # compile marcros -TARGET_NAME := dji_check_stream +TARGET_NAME := stream_check_tool ifeq ($(OS),Windows_NT) TARGET_NAME := $(addsuffix .exe,$(TARGET_NAME)) endif diff --git a/application/inc/h264_checker.h b/application/inc/h264_checker.h index 4591e4b..d2f6973 100644 --- a/application/inc/h264_checker.h +++ b/application/inc/h264_checker.h @@ -62,6 +62,9 @@ class H264Checker : public CheckerBase { //SPS *mSps; int mFrameCnt; + uint32_t frameCount; + uint32_t framePassedCount; + uint32_t totalCount; }; #endif /* __H264_CHECKER_H__ */ diff --git a/application/src/chk_strm_entry.cpp b/application/src/chk_strm_entry.cpp index 0987f32..77c493b 100644 --- a/application/src/chk_strm_entry.cpp +++ b/application/src/chk_strm_entry.cpp @@ -34,49 +34,230 @@ #include "udp_receiver.h" #include "stream_buffer.h" -#define TOOL_VERSION_MAJOR 1 -#define TOOL_VERSION_MINOR 0 -#define TOOL_VERSION_MODIFY 0 -#define TOOL_VERSION_BUILD 0 +#define TOOL_VERSION_MAJOR 1 +#define TOOL_VERSION_MINOR 0 +#define TOOL_VERSION_MODIFY 0 + +#define MODE_INVALD 0 +#define MODE_UDP_RECEIVER 1 +#define MODE_FILE_READER 2 + +#define VIDEO_STREAM_TYPE_INVALID 0 +#define VIDEO_STREAM_TYPE_DJI_H264 1 +#define VIDEO_STREAM_TYPE_CUSTOM_H264 2 + +#define VIDEO_FRAME_MAX_COUNT (18000) +#define VIDEO_FRAME_AUD_LEN (6) + +static const uint8_t s_frameAudInfo[VIDEO_FRAME_AUD_LEN] = {0x00, 0x00, 0x00, 0x01, 0x09, 0x10}; typedef struct chk_info_t { char *filename; int mode; int port; + int type; StreamBuffer *stream; CheckerBase *checker; ReceiverBase *receiver; } chk_info_t, *chk_info_handle_t; +typedef struct { + float durationS; + uint32_t positionInFile; + uint32_t size; +} video_frame_info_t; + void usage() { - fprintf(stderr, "\ndji_check_stream usage:\n"); - fprintf(stderr, "./dji_check_stream <-u [-p ] |-f -i > [-h]\n"); + fprintf(stderr, "\nstream_check_tool usage:\n"); + fprintf(stderr, "./stream_check_tool <-u [-p ] [-t ] |-f [-i ] [-t ] > [-h] [-v]\n"); + fprintf(stderr, "\n-t type: Stream type, can be any value of \"DJI-H264\" or \"Custom-H264\"\n\n"); fprintf(stderr, "sample:\n"); - fprintf(stderr, "case 1: using a udp receive, a frame stream should end up with an AUD\n"); - fprintf(stderr, " dji_check_stream -u -p udp_port\n"); - fprintf(stderr, " udp_port is the one you sendto default is 45654\n\n"); - fprintf(stderr, "case 2: using a file reader\n"); - fprintf(stderr, " dji_check_stream -f -i filename\n"); - fprintf(stderr, " filename should in ascii charactor path, could not be ignored\n"); + fprintf(stderr, + "case 1: video stream received by UDP transmission channel as input, and please ensure every frame end with AUD (0x00 0x00 0x00 0x01 0x09 0x10)\n"); + fprintf(stderr, " stream_check_tool -u -p udp_port -t stream_type\n"); + fprintf(stderr, " udp_port is the UDP port which send video stream to, and the default value is 45654\n\n"); + fprintf(stderr, "case 2: video file as input\n"); + fprintf(stderr, " stream_check_tool -f -i filename -t stream_type\n"); exit(1); } void version() { - fprintf(stderr, "\ndji_check_stream Version:V%02d.%02d.%02d.%02d\n", + fprintf(stderr, "\ndji_check_stream Version:V%02d.%02d.%02d\n", TOOL_VERSION_MAJOR, TOOL_VERSION_MINOR, - TOOL_VERSION_MODIFY, - TOOL_VERSION_BUILD); + TOOL_VERSION_MODIFY); exit(1); } -#define MODE_INVALD 0 -#define MODE_UDP_RECEIVER 1 -#define MODE_FILE_READER 2 +int32_t getH264Nalu(FILE *pFile, uint8_t *pNalu, uint32_t *packetLength, uint32_t *filePosition) +{ + int32_t pos = 0; + int32_t len = 0; + + if (pFile == NULL) { + return -1; + } + + if (fread(pNalu, 1, 4, pFile) <= 0) { + return -1; + } + + if (pNalu[0] != 0 || pNalu[1] != 0 || pNalu[2] != 0 || pNalu[3] != 1) { + return -1; + } + + pos = 4; + + while (1) { + if (feof(pFile)) + break; + + pNalu[pos] = fgetc(pFile); + + if (pNalu[pos - 3] == 0 && pNalu[pos - 2] == 0 && pNalu[pos - 1] == 0 && pNalu[pos] == 1) { + fseek(pFile, -4, SEEK_CUR); + pos -= 4; + break; + } + + pos++; + } + + len = pos + 1; + + *packetLength = len; + *filePosition = ftell(pFile); + + return len; +} + +int32_t getFrameInfoOfVideoFile(const char *path, video_frame_info_t *frameInfo, uint32_t frameInfoBufferCount, + uint32_t *frameCount) +{ + FILE *pFile = NULL; + int32_t len; + unsigned char *pBuf = NULL; + unsigned char *pNalu = NULL; + unsigned char naluType; + bool addSlice = false; + uint32_t spsLen = 0; + uint32_t ppsLen = 0; + uint32_t sliceLen = 0; + uint32_t packetCount = 0; + uint32_t length = 0; + uint32_t position = 0; + + pFile = fopen(path, "rb"); + if (pFile == NULL) { + printf("Open file error"); + return -1; + } + + pBuf = (unsigned char *) malloc(1024 * 1024); + if (pBuf == NULL) { + printf("Malloc error"); + return -1; + } + + while (1) { + len = getH264Nalu(pFile, pBuf, &length, &position); + if (len <= 0) + break; + + if (pBuf[0] != 0 || pBuf[1] != 0 || pBuf[2] != 0 || pBuf[3] != 1) + continue; + + pNalu = pBuf + 4; + naluType = pNalu[0] & 0x1F; + + switch (naluType) { + case 0x07: // SPS + spsLen = len; + break; + case 0x08: // PPS + ppsLen = len; + addSlice = true; + break; + default: + if (addSlice == true) { + sliceLen = len + spsLen + ppsLen; + addSlice = false; + } else { + sliceLen = len; + } + frameInfo[packetCount].size = sliceLen; + frameInfo[packetCount].positionInFile = position - frameInfo[packetCount].size; + *frameCount = packetCount; + + if (packetCount >= frameInfoBufferCount) { + printf("frame buffer is full."); + goto out; + } + packetCount++; + break; + } + } + +out: + free(pBuf); + fclose(pFile); + + return 0; +} + +void addAudInfoForCustomH264(const char *filename) +{ + FILE *fpFile = NULL; + FILE *fpFileOut = NULL; + uint32_t frameCount = 0; + video_frame_info_t *frameInfo = NULL; + uint8_t *dataBuffer; + uint32_t dataLength = 0; + int32_t ret = 0; + + frameInfo = (video_frame_info_t *) malloc( + VIDEO_FRAME_MAX_COUNT * sizeof(video_frame_info_t)); + if (frameInfo == NULL) { + printf("Malloc error"); + exit(1); + } + + fpFile = fopen(filename, "rb+"); + if (fpFile == NULL) { + printf("Open video file fail"); + sleep(1); + } + + fpFileOut = fopen("tmp.h264", "wb+"); + if (fpFileOut == NULL) { + exit(1); + } + + getFrameInfoOfVideoFile(filename, frameInfo, VIDEO_FRAME_MAX_COUNT, &frameCount); + + uint32_t i = 0; + for (i = 0; i < frameCount; i++) { + dataBuffer = (uint8_t *) calloc(frameInfo[i].size + VIDEO_FRAME_AUD_LEN, 1); + if (dataBuffer == NULL) { + printf("Malloc fail"); + } + + ret = fseek(fpFile, frameInfo[i].positionInFile, SEEK_SET); + if (ret != 0) { + printf("Seek file fail"); + } + + dataLength = fread(dataBuffer, 1, frameInfo[i].size, fpFile); + memcpy(&dataBuffer[frameInfo[i].size], s_frameAudInfo, VIDEO_FRAME_AUD_LEN); + dataLength = dataLength + VIDEO_FRAME_AUD_LEN; + fwrite(dataBuffer, 1, dataLength, fpFileOut); + free(dataBuffer); + } +} int main(int argc, char *argv[]) { @@ -87,54 +268,79 @@ int main(int argc, char *argv[]) memset(chk_info, 0, sizeof(chk_info_t)); chk_info->port = 45654; - while((ch = getopt(argc, argv, "up:fi:h")) != -1) { - switch(ch) { - case 'u': - chk_info->mode = MODE_UDP_RECEIVER; - break; - case 'p': - chk_info->port = atoi(optarg); - break; - case 'f': - chk_info->mode = MODE_FILE_READER; - break; - case 'i': - chk_info->filename = strdup(optarg); - break; - case 'h': - usage(); + while ((ch = getopt(argc, argv, "up:fi:hvt:")) != -1) { + switch (ch) { + case 'u': + chk_info->mode = MODE_UDP_RECEIVER; + break; + case 'p': + chk_info->port = atoi(optarg); + break; + case 'f': + chk_info->mode = MODE_FILE_READER; + break; + case 'i': + chk_info->filename = strdup(optarg); + break; + case 'h': + usage(); break; case 'v': + version(); + break; + case 't': + if (strcmp(optarg, "Custom-H264") == 0) { + chk_info->type = VIDEO_STREAM_TYPE_CUSTOM_H264; + } else if (strcmp(optarg, "DJI-H264") == 0) { + chk_info->type = VIDEO_STREAM_TYPE_DJI_H264; + } else { + fprintf(stderr, "invalid video stream type:%s\n", strdup(optarg)); + exit(0); + } break; default: - fprintf(stderr, "option %c mismatched\n", ch); - usage(); - break; + fprintf(stderr, "option %c mismatched\n", ch); + usage(); + break; } } + if (VIDEO_STREAM_TYPE_INVALID == chk_info->type) { + fprintf(stderr, "please input the video stream type, such as DJI-H264 or Custom-H264\n\n"); + exit(0); + } + switch (chk_info->mode) { - case MODE_UDP_RECEIVER: - /* TODO: */ - fprintf(stderr, "udp reader mode, port %d\n", chk_info->port); - chk_info->stream = new StreamBuffer(MAX_J_STEAM_SIZE, 10); - chk_info->checker = new H264Checker(chk_info->stream); - chk_info->receiver = new UdpReceiver(chk_info->stream, chk_info->port); - break; - case MODE_FILE_READER: - if (!chk_info->filename) { - fprintf(stderr, "file reader mode, filename must be filled\n"); + case MODE_UDP_RECEIVER: + fprintf(stderr, "udp reader mode, port %d\n", chk_info->port); + chk_info->stream = new StreamBuffer(MAX_J_STEAM_SIZE, 10); + chk_info->checker = new H264Checker(chk_info->stream); + if (chk_info->type == VIDEO_STREAM_TYPE_CUSTOM_H264) { + fprintf(stderr, "udp receive mode not support this video stream format\n"); + exit(1); + } else { + chk_info->receiver = new UdpReceiver(chk_info->stream, chk_info->port); + } + break; + case MODE_FILE_READER: + if (!chk_info->filename) { + fprintf(stderr, "file reader mode, filename must be filled\n"); + usage(); + exit(1); + } + chk_info->stream = new StreamBuffer(MAX_J_STEAM_SIZE, 10); + chk_info->checker = new H264Checker(chk_info->stream); + if (chk_info->type == VIDEO_STREAM_TYPE_CUSTOM_H264) { + addAudInfoForCustomH264(chk_info->filename); + chk_info->receiver = new FileReceiver(chk_info->stream, (char *) "tmp.h264"); + } else { + chk_info->receiver = new FileReceiver(chk_info->stream, chk_info->filename); + } + break; + default: + fprintf(stderr, "invalid parameters\n"); usage(); exit(1); - } - chk_info->stream = new StreamBuffer(MAX_J_STEAM_SIZE, 10); - chk_info->checker = new H264Checker(chk_info->stream); - chk_info->receiver = new FileReceiver(chk_info->stream, chk_info->filename); - break; - default: - fprintf(stderr, "invalid parameters\n"); - usage(); - exit(1); } while (1) { diff --git a/application/src/file_receiver.cpp b/application/src/file_receiver.cpp index 877ccc5..3de5a53 100644 --- a/application/src/file_receiver.cpp +++ b/application/src/file_receiver.cpp @@ -25,6 +25,8 @@ #include "file_receiver.h" #include +#define STANDARDS_TEST_NUM (15) + const uint32_t kBufferSize = 1024 * 1024; const uint32_t kStreamMaxSize = MAX_J_STEAM_SIZE; static const uint8_t kAudHex[] = {0x00, 0x00, 0x01, 0x09, 0x10}; @@ -106,7 +108,10 @@ int FileReceiver::recvStream(JBuffer *buffer) /* need to read more buffer from file */ ret = readStreamFromFile(); if (ret) { - JLOGR_PASSED("Congratulations, your stream has passed DJI's strict standards test.\n"); + for (int i = 0; i < STANDARDS_TEST_NUM; ++i) { + printf("\n"); + } + //JLOGR_PASSED("Congratulations, your video stream has passed the above standards test.\n"); exit(0); } continue; diff --git a/application/src/h264_checker.cpp b/application/src/h264_checker.cpp index 2c890dc..3b7f909 100644 --- a/application/src/h264_checker.cpp +++ b/application/src/h264_checker.cpp @@ -150,7 +150,7 @@ int H264Checker::decode(JBuffer *buffer) ret = avcodec_send_packet(mCtx, mPkt); if (ret < 0) { JLOGF("Error sending a packet for decoding"); - exit(1); +// exit(1); } while (ret >= 0) { @@ -163,8 +163,7 @@ int H264Checker::decode(JBuffer *buffer) exit(1); } - JLOGU("Decode frame done! Frame resolution [%dx%d] index:%4d", - mFrame->width, mFrame->height, mCtx->frame_number); + JLOGU("Decode frame done! Frame index:%4d", mCtx->frame_number); /* dump yuv */ #ifndef PROG_RELEASE @@ -192,7 +191,6 @@ int H264Checker::checkFrame() /* TODO: according to dji video stream stardard */ SPS *sps = (SPS *) h264_get_sps_from_ctx(mCtx); PPS *pps = (PPS *) h264_get_pps_from_ctx(mCtx); - int long_term_reference = h264_get_long_term_reference_from_ctx(mCtx); int max_num_reorder_frames = h264_get_max_num_reorder_frames(mCtx); int max_dec_frame_buffering = h264_get_max_dec_frame_buffering(mCtx); @@ -211,18 +209,21 @@ int H264Checker::checkFrame() // pps->slice_group_count, sps->ref_frame_count, sps->num_reorder_frames // ); + frameCount++; + if (mPkt->size > 256 * 1024) { - JLOGR_FAILED("0.stream size is larger than 256K (reference 7.3.2.1.1)"); + JLOGR_FAILED("0.stream size is larger than 256K, reference 7.3.2.1.1"); } else { - JLOGR_PASSED("0.stream size is ok (reference 7.3.2.1.1)"); + totalCount++; + JLOGR_PASSED("0.stream size(reference 7.3.2.1.1)"); } /*! Stream standard 1: profile_idc */ if (sps->profile_idc != 66 && sps->profile_idc != 77 && sps->profile_idc != 100) { JLOGR_FAILED("1.profile_idc %d, should be 66, 77 or 100, reference 7.3.2.1.1", sps->profile_idc); - exit(100); } else { + totalCount++; JLOGR_PASSED("1.profile_idc (reference 7.3.2.1.1)"); } @@ -230,8 +231,8 @@ int H264Checker::checkFrame() if (sps->level_idc > 51) { JLOGR_FAILED("2.level_idc %0.1f, should less than 5.1, reference 7.3.2.1.1", sps->level_idc / 10.0); - exit(100); } else { + totalCount++; JLOGR_PASSED("2.level_idc (reference 7.3.2.1.1)"); } @@ -239,8 +240,8 @@ int H264Checker::checkFrame() if (sps->chroma_format_idc != 1) { JLOGR_FAILED("3.chroma_format_idc %d, should be 1(YUV420), reference 7.3.2.1.1", sps->chroma_format_idc); - exit(100); } else { + totalCount++; JLOGR_PASSED("3.YUV420 chroma_format_idc (reference 7.3.2.1.1)"); } @@ -249,8 +250,8 @@ int H264Checker::checkFrame() JLOGR_FAILED("4.bit_depth_luma_minus8 %d bit_depth_chroma_minus8 %d" ", should be 0(only 8-bit depth allowed), reference 7.3.2.1.1", sps->bit_depth_luma - 8, sps->bit_depth_chroma - 8); - exit(100); } else { + totalCount++; JLOGR_PASSED("4.chroma and luma only allow 8 bit (reference 7.3.2.1.1)"); } @@ -260,8 +261,8 @@ int H264Checker::checkFrame() JLOGR_FAILED("5.seq_scaling_matrix_presenst_flag %d" ", should be 0, reference 7.3.2.1.1 and 7.3.2.2", sps->scaling_matrix_present); - exit(100); } else { + totalCount++; JLOGR_PASSED("5.seq_scaling_matrix_presenst_flag (reference 7.3.2.1.1 and 7.3.2.2)"); } @@ -269,8 +270,8 @@ int H264Checker::checkFrame() if (sps->frame_mbs_only_flag != 1) { JLOGR_FAILED("6.frame_mbs_only_flag %d, should be 1, reference 7.3.2.1.1", sps->frame_mbs_only_flag); - exit(100); } else { + totalCount++; JLOGR_PASSED("6.frame_mbs_only_flag (reference 7.3.2.1.1)"); } @@ -280,8 +281,8 @@ int H264Checker::checkFrame() JLOGR_FAILED("[7.slice_type %d, should be 0 or 2, reference 7.3.3", ff_pict_type_to_slice_type[mParser->pict_type]); - exit(100); } else { + totalCount++; JLOGR_PASSED("7.slice_type (reference 7.3.3)"); } @@ -298,8 +299,8 @@ int H264Checker::checkFrame() if (pps->slice_group_count != 1) { JLOGR_FAILED("8.num_slice_groups_minus1 %d, should be 0, reference 7.3.2.2", pps->slice_group_count - 1); - exit(100); } else { + totalCount++; JLOGR_PASSED("8.num_slice_groups_minus1 (reference 7.3.2.2)"); } @@ -307,8 +308,8 @@ int H264Checker::checkFrame() if (sps->ref_frame_count != 1) { JLOGR_FAILED("9.max_num_ref_frames %d, should be 1, reference 7.3.2.1.1", sps->ref_frame_count); - exit(100); } else { + totalCount++; JLOGR_PASSED("9.max_num_ref_frames (reference 7.3.2.1.1)"); } @@ -337,31 +338,26 @@ int H264Checker::checkFrame() if (sps->mb_width > 120 || sps->mb_height > 68) { JLOGR_FAILED("10.width*height %dx%d, should less than 1920*1088, reference 7.3.2.1.1", sps->mb_width * 16, sps->mb_height * 16); - exit(100); } else { - JLOGR_PASSED("10.maximum resolution limit (reference 7.3.2.1.1) %d %d", sps->time_scale, - sps->num_units_in_tick); + totalCount++; + JLOGR_PASSED("10.video resolution (reference 7.3.2.1.1)"); } -// /*! Stream standard 11: long_term_reference */ -// if (long_term_reference != 0) { -// } else { -// JLOGR_PASSED("11.long_term_reference limit (reference 7.3.2.1.1)"); -// } -// -// /*! Stream standard 12: max_num_reorder_frames */ -// if (max_num_reorder_frames != 0) { -// } else { -// JLOGR_PASSED("12.max_num_reorder_frames limit(reference 7.3.2.1.1)"); -// } -// -// /*! Stream standard 13: max_dec_frame_buffering */ -// if (max_dec_frame_buffering != 5) { -// } else { -// JLOGR_PASSED("13.max_dec_frame_buffering limit(reference 7.3.2.1.1)"); -// } + if (totalCount / 11 == frameCount) { + framePassedCount++; + } printf("\n"); + if (frameCount != framePassedCount) { + JLOGR_FAILED("Currently, some frames failed the above standards test, frameCount:%d, totalCount:%d", + frameCount, framePassedCount); + } else { + JLOGR_PASSED("Currently, all frames has passed the above standards test."); + } + + fflush(stdout); + printf("\033[14A"); + printf("\033[K"); return 0; }