1/******************************************************************************
2*
3* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at:
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*
17******************************************************************************/
18/**
19*******************************************************************************
20* @file
21*  ihevcd_version.c
22*
23* @brief
24*  Contains version info for HEVC decoder
25*
26* @author
27*  Harish
28*
29* @par List of Functions:
30* - ihevcd_get_version()
31*
32* @remarks
33*  None
34*
35*******************************************************************************
36*/
37/*****************************************************************************/
38/* File Includes                                                             */
39/*****************************************************************************/
40#include <stdio.h>
41#include <stddef.h>
42#include <stdlib.h>
43#include <string.h>
44
45#include "ihevc_typedefs.h"
46#include "iv.h"
47#include "ivd.h"
48#include "ihevcd_cxa.h"
49
50#include "ihevc_defs.h"
51#include "ihevc_debug.h"
52#include "ihevc_structs.h"
53/**
54 * Name of the codec
55 */
56#define CODEC_NAME              "HEVCDEC"
57/**
58 * Codec release type, production or evaluation
59 */
60#define CODEC_RELEASE_TYPE      "production"
61/**
62 * Version string. First two digits signify major version and last two minor
63 * Increment major version for API change or major feature update
64 */
65#define CODEC_RELEASE_VER       "04.01"
66/**
67 * Vendor name
68 */
69#define CODEC_VENDOR            "ITTIAM"
70
71/**
72*******************************************************************************
73* Concatenates various strings to form a version string
74*******************************************************************************
75*/
76#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor)    \
77    strcpy(version_string,"@(#)Id:");                                                               \
78    strcat(version_string,codec_name);                                                              \
79    strcat(version_string,"_");                                                                     \
80    strcat(version_string,codec_release_type);                                                      \
81    strcat(version_string," Ver:");                                                                 \
82    strcat(version_string,codec_release_ver);                                                       \
83    strcat(version_string," Released by ");                                                         \
84    strcat(version_string,codec_vendor);                                                            \
85    strcat(version_string," Build: ");                                                              \
86    strcat(version_string,__DATE__);                                                                \
87    strcat(version_string," @ ");                                                                   \
88    strcat(version_string,__TIME__);
89
90
91/**
92*******************************************************************************
93*
94* @brief
95*  Fills the version info in the given string
96*
97* @par Description:
98*
99*
100* @param[in] pc_version_string
101*  Pointer to hold version info
102*
103* @param[in] u4_version_buffer_size
104*  Size of the buffer passed
105*
106* @returns  Status
107*
108* @remarks
109*
110*
111*******************************************************************************
112*/
113IV_API_CALL_STATUS_T ihevcd_get_version(CHAR *pc_version_string,
114                                        UWORD32 u4_version_buffer_size)
115{
116    CHAR ac_version_tmp[512];
117    VERSION(ac_version_tmp, CODEC_NAME, CODEC_RELEASE_TYPE, CODEC_RELEASE_VER, CODEC_VENDOR);
118
119    if(u4_version_buffer_size >= (strlen(ac_version_tmp) + 1))
120    {
121        memcpy(pc_version_string, ac_version_tmp, (strlen(ac_version_tmp) + 1));
122        return IV_SUCCESS;
123    }
124    else
125    {
126        return IV_FAIL;
127    }
128
129}
130
131
132