From 7c3f05186d1143baa80b357536c988f2bf81a38f Mon Sep 17 00:00:00 2001 From: Frank Du Date: Sat, 7 Oct 2023 10:24:40 +0800 Subject: [PATCH] sample: add "--ptp" args (#526) To enable the built-in ptp for sample app. Signed-off-by: Frank Du --- app/sample/sample_util.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/sample/sample_util.c b/app/sample/sample_util.c index ff0773923..5dcd19a85 100644 --- a/app/sample/sample_util.c +++ b/app/sample/sample_util.c @@ -59,6 +59,7 @@ enum sample_args_cmd { SAMPLE_ARG_RX_DUMP, SAMPLE_ARG_USE_CPU_COPY, SAMPLE_ARG_USER_META, + SAMPLE_ARG_LIB_PTP, SAMPLE_ARG_UDP_MODE = 0x300, SAMPLE_ARG_UDP_LEN, @@ -108,6 +109,7 @@ static struct option sample_args_options[] = { {"ext_frame", no_argument, 0, SAMPLE_ARG_EXT_FRAME}, {"st22_codec", required_argument, 0, SAMPLE_ARG_ST22_CODEC}, {"pipeline_fmt", required_argument, 0, SAMPLE_ARG_PIPELINE_FRAME_FMT}, + {"ptp", no_argument, 0, SAMPLE_ARG_LIB_PTP}, {"udp_mode", required_argument, 0, SAMPLE_ARG_UDP_MODE}, {"udp_len", required_argument, 0, SAMPLE_ARG_UDP_LEN}, @@ -244,6 +246,9 @@ static int _sample_parse_args(struct st_sample_context* ctx, int argc, char** ar case SAMPLE_ARG_PTP_TSC: p->flags |= MTL_FLAG_PTP_SOURCE_TSC; break; + case SAMPLE_ARG_LIB_PTP: + p->flags |= MTL_FLAG_PTP_ENABLE; + break; case SAMPLE_ARG_UDP_LCORE: p->flags |= MTL_FLAG_UDP_LCORE; break;