summaryrefslogtreecommitdiffstats
path: root/decoder/ihevcd_version.c
blob: ee214b249fb44612fa26ddfcab1753ef99584946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/******************************************************************************
*
* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************/
/**
*******************************************************************************
* @file
*  ihevcd_version.c
*
* @brief
*  Contains version info for HEVC decoder
*
* @author
*  Harish
*
* @par List of Functions:
* - ihevcd_get_version()
*
* @remarks
*  None
*
*******************************************************************************
*/
/*****************************************************************************/
/* File Includes                                                             */
/*****************************************************************************/
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

#include "ihevc_typedefs.h"
#include "iv.h"
#include "ivd.h"
#include "ihevcd_cxa.h"

#include "ihevc_defs.h"
#include "ihevc_debug.h"
#include "ihevc_structs.h"
/**
 * Name of the codec
 */
#define CODEC_NAME              "HEVCDEC"
/**
 * Codec release type, production or evaluation
 */
#define CODEC_RELEASE_TYPE      "production"
/**
 * Version string. First two digits signify major version and last two minor
 * Increment major version for API change or major feature update
 */
#define CODEC_RELEASE_VER       "05.00"
/**
 * Vendor name
 */
#define CODEC_VENDOR            "ITTIAM"

/**
*******************************************************************************
* Concatenates various strings to form a version string
*******************************************************************************
*/
#define MAXVERSION_STRLEN       511
#ifdef __ANDROID__
#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor)    \
    snprintf(version_string, MAXVERSION_STRLEN,                                                     \
             "@(#)Id:%s_%s Ver:%s Released by %s",                                                  \
             codec_name, codec_release_type, codec_release_ver, codec_vendor)
#else
#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor)    \
    snprintf(version_string, MAXVERSION_STRLEN,                                                     \
             "@(#)Id:%s_%s Ver:%s Released by %s Build: %s @ %s",                                   \
             codec_name, codec_release_type, codec_release_ver, codec_vendor, __DATE__, __TIME__)
#endif

/**
*******************************************************************************
*
* @brief
*  Fills the version info in the given string
*
* @par Description:
*
*
* @param[in] pc_version_string
*  Pointer to hold version info
*
* @param[in] u4_version_buffer_size
*  Size of the buffer passed
*
* @returns  Status
*
* @remarks
*
*
*******************************************************************************
*/
IV_API_CALL_STATUS_T ihevcd_get_version(CHAR *pc_version_string,
                                        UWORD32 u4_version_buffer_size)
{
    CHAR ac_version_tmp[MAXVERSION_STRLEN + 1];
    UWORD32 u4_len;
    VERSION(ac_version_tmp, CODEC_NAME, CODEC_RELEASE_TYPE, CODEC_RELEASE_VER, CODEC_VENDOR);
    u4_len = strnlen(ac_version_tmp, MAXVERSION_STRLEN) + 1;
    if(u4_version_buffer_size >= u4_len)
    {
        memcpy(pc_version_string, ac_version_tmp, u4_len);
        return IV_SUCCESS;
    }
    else
    {
        return IV_FAIL;
    }

}