ihevcd_version.c revision ff8f9c0a287aebc5113d376a6afb82212a53b14e
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.05" 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 MAXVERSION_STRLEN 511 77#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ 78 snprintf(version_string, MAXVERSION_STRLEN, \ 79 "@(#)Id:%s_%s Ver:%s Released by %s Build: %s @ %s", \ 80 codec_name, codec_release_type, codec_release_ver, codec_vendor, __DATE__, __TIME__) 81 82/** 83******************************************************************************* 84* 85* @brief 86* Fills the version info in the given string 87* 88* @par Description: 89* 90* 91* @param[in] pc_version_string 92* Pointer to hold version info 93* 94* @param[in] u4_version_buffer_size 95* Size of the buffer passed 96* 97* @returns Status 98* 99* @remarks 100* 101* 102******************************************************************************* 103*/ 104IV_API_CALL_STATUS_T ihevcd_get_version(CHAR *pc_version_string, 105 UWORD32 u4_version_buffer_size) 106{ 107 CHAR ac_version_tmp[MAXVERSION_STRLEN + 1]; 108 UWORD32 u4_len; 109 VERSION(ac_version_tmp, CODEC_NAME, CODEC_RELEASE_TYPE, CODEC_RELEASE_VER, CODEC_VENDOR); 110 u4_len = strnlen(ac_version_tmp, MAXVERSION_STRLEN) + 1; 111 if(u4_version_buffer_size >= u4_len) 112 { 113 memcpy(pc_version_string, ac_version_tmp, u4_len); 114 return IV_SUCCESS; 115 } 116 else 117 { 118 return IV_FAIL; 119 } 120 121} 122 123 124