summaryrefslogtreecommitdiffstats
path: root/encoder/ih264e_version.c
blob: 173f17c38575b24d7664fa984166e8cf836a0ec1 (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
131
132
133
134
/******************************************************************************
 *
 * Copyright (C) 2015 The Android Open Source Project
 *
 * 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.
 *
 *****************************************************************************
 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
*/

/**
*******************************************************************************
* @file
*  ih264e_version.c
*
* @brief
*  Contains version info for H264 encoder
*
* @author
*  ittiam
*
* @par List of Functions:
* - ih264e_get_version()
*
* @remarks
*  None
*
*******************************************************************************
*/

/*****************************************************************************/
/* File Includes                                                             */
/*****************************************************************************/
/* system include files */
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>

/* user include files */
#include "ih264_typedefs.h"
#include "iv2.h"
#include "ive2.h"
#include "ih264e.h"
#include "ih264_defs.h"
#include "ih264_debug.h"
#include "ih264_structs.h"
#include "ih264e_version.h"


/*****************************************************************************/
/* Constant Macros                                                           */
/*****************************************************************************/

/**
 * Name of the codec and target platform (All Cortex A processors in this case)
 */
#define CODEC_NAME              "H264ENC"
/**
 * Codec release type, production or evaluation
 */
#define CODEC_RELEASE_TYPE      "production"
/**
 * Version string. First two digits signify major version and last two minor
 */
#define CODEC_RELEASE_VER       "01.00"
/**
 * Vendor name
 */
#define CODEC_VENDOR            "ITTIAM"

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

/*****************************************************************************/
/* Function Definitions                                                      */
/*****************************************************************************/

/**
*******************************************************************************
*
* @brief
*  Fills the version info in the given char pointer
*
* @par Description:
*  Fills the version info in the given char pointer
*
* @param[in] pc_version
*  Pointer to hold version info
*
* @param[in] u4_version_bufsize
*  Size of the buffer passed
*
* @returns error status
*
* @remarks none
*
*******************************************************************************
*/
IV_STATUS_T ih264e_get_version(CHAR *pc_version, UWORD32 u4_version_bufsize)
{
    CHAR ac_version_tmp[MAX_STRLEN];

    VERSION(ac_version_tmp, CODEC_NAME, CODEC_RELEASE_TYPE, CODEC_RELEASE_VER,
            CODEC_VENDOR);

    if (u4_version_bufsize >= (strlen(ac_version_tmp) + 1))
    {
        memcpy(pc_version, ac_version_tmp, (strlen(ac_version_tmp) + 1));
        return IV_SUCCESS;
    }
    else
    {
        return IV_FAIL;
    }
}