xref: /OK3568_Linux_fs/external/mpp/mpp/mpp_info.cpp (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2015 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #define MODULE_TAG "mpp_info"
18 
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #include "mpp_log.h"
23 #include "mpp_env.h"
24 #include "mpp_info.h"
25 
26 #include "version.h"
27 
28 /*
29  * To avoid string | grep author getting multiple results
30  * use commit to replace author
31  */
32 static const char mpp_version[] = MPP_VERSION;
33 static const RK_S32 mpp_history_cnt = MPP_VER_HIST_CNT;
34 static const char *mpp_history[]  = {
35     MPP_VER_HIST_0,
36     MPP_VER_HIST_1,
37     MPP_VER_HIST_2,
38     MPP_VER_HIST_3,
39     MPP_VER_HIST_4,
40     MPP_VER_HIST_5,
41     MPP_VER_HIST_6,
42     MPP_VER_HIST_7,
43     MPP_VER_HIST_8,
44     MPP_VER_HIST_9,
45 };
46 
show_mpp_version(void)47 void show_mpp_version(void)
48 {
49     RK_U32 show_history = 0;
50 
51     mpp_env_get_u32("mpp_show_history", &show_history, 0);
52 
53     if (show_history) {
54         RK_S32 i;
55 
56         mpp_log("mpp version history %d:\n", mpp_history_cnt);
57         for (i = 0; i < mpp_history_cnt; i++)
58             mpp_log("%s\n", mpp_history[i]);
59     } else
60         mpp_log("mpp version: %s\n", mpp_version);
61 }
62 
get_mpp_version(void)63 const char *get_mpp_version(void)
64 {
65     return mpp_version;
66 }
67