1 /* SPDX-License-Identifier: Apache-2.0 OR MIT */
2 /*
3 * Copyright (c) 2015 Rockchip Electronics Co., Ltd.
4 */
5
6 #define MODULE_TAG "mpp_info"
7
8 #include <stdlib.h>
9 #include <string.h>
10
11 #include "mpp_log.h"
12 #include "mpp_env.h"
13 #include "mpp_info.h"
14
15 #include "version.h"
16
17 /*
18 * To avoid string | grep author getting multiple results
19 * use commit to replace author
20 */
21 static const char mpp_version[] = MPP_VERSION;
22 static const RK_S32 mpp_history_cnt = MPP_VER_HIST_CNT;
23 static const char *mpp_history[] = {
24 MPP_VER_HIST_0,
25 MPP_VER_HIST_1,
26 MPP_VER_HIST_2,
27 MPP_VER_HIST_3,
28 MPP_VER_HIST_4,
29 MPP_VER_HIST_5,
30 MPP_VER_HIST_6,
31 MPP_VER_HIST_7,
32 MPP_VER_HIST_8,
33 MPP_VER_HIST_9,
34 };
35
show_mpp_version(void)36 void show_mpp_version(void)
37 {
38 RK_U32 show_history = 0;
39
40 mpp_env_get_u32("mpp_show_history", &show_history, 0);
41
42 if (show_history) {
43 RK_S32 i;
44
45 mpp_log("mpp version history %d:\n", mpp_history_cnt);
46 for (i = 0; i < mpp_history_cnt; i++)
47 mpp_log("%s\n", mpp_history[i]);
48 } else
49 mpp_log("mpp version: %s\n", mpp_version);
50 }
51
get_mpp_version(void)52 const char *get_mpp_version(void)
53 {
54 return mpp_version;
55 }
56