1/****************************************************************************** 2 * 3 * Copyright (C) 2015 The Android Open Source Project 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 * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore 19*/ 20 21/** 22******************************************************************************* 23* @file 24* ih264e_version.c 25* 26* @brief 27* Contains version info for H264 encoder 28* 29* @author 30* ittiam 31* 32* @par List of Functions: 33* - ih264e_get_version() 34* 35* @remarks 36* None 37* 38******************************************************************************* 39*/ 40 41/*****************************************************************************/ 42/* File Includes */ 43/*****************************************************************************/ 44/* system include files */ 45#include <stdio.h> 46#include <stddef.h> 47#include <stdlib.h> 48#include <string.h> 49 50/* user include files */ 51#include "ih264_typedefs.h" 52#include "iv2.h" 53#include "ive2.h" 54#include "ih264e.h" 55#include "ih264_defs.h" 56#include "ih264_debug.h" 57#include "ih264_structs.h" 58#include "ih264e_version.h" 59 60 61/*****************************************************************************/ 62/* Constant Macros */ 63/*****************************************************************************/ 64 65/** 66 * Name of the codec and target platform (All Cortex A processors in this case) 67 */ 68#define CODEC_NAME "H264ENC" 69/** 70 * Codec release type, production or evaluation 71 */ 72#define CODEC_RELEASE_TYPE "production" 73/** 74 * Version string. First two digits signify major version and last two minor 75 */ 76#define CODEC_RELEASE_VER "01.00" 77/** 78 * Vendor name 79 */ 80#define CODEC_VENDOR "ITTIAM" 81 82#define MAX_STRLEN 511 83/** 84******************************************************************************* 85* Concatenates various strings to form a version string 86******************************************************************************* 87*/ 88#define VERSION(version_string, codec_name, codec_release_type, codec_release_ver, codec_vendor) \ 89 snprintf(version_string, MAX_STRLEN, \ 90 "@(#)Id:%s_%s Ver:%s Released by %s Build: %s @ %s", \ 91 codec_name, codec_release_type, codec_release_ver, codec_vendor, __DATE__, __TIME__) 92 93/*****************************************************************************/ 94/* Function Definitions */ 95/*****************************************************************************/ 96 97/** 98******************************************************************************* 99* 100* @brief 101* Fills the version info in the given char pointer 102* 103* @par Description: 104* Fills the version info in the given char pointer 105* 106* @param[in] pc_version 107* Pointer to hold version info 108* 109* @param[in] u4_version_bufsize 110* Size of the buffer passed 111* 112* @returns error status 113* 114* @remarks none 115* 116******************************************************************************* 117*/ 118IV_STATUS_T ih264e_get_version(CHAR *pc_version, UWORD32 u4_version_bufsize) 119{ 120 CHAR ac_version_tmp[MAX_STRLEN]; 121 122 VERSION(ac_version_tmp, CODEC_NAME, CODEC_RELEASE_TYPE, CODEC_RELEASE_VER, 123 CODEC_VENDOR); 124 125 if (u4_version_bufsize >= (strlen(ac_version_tmp) + 1)) 126 { 127 memcpy(pc_version, ac_version_tmp, (strlen(ac_version_tmp) + 1)); 128 return IV_SUCCESS; 129 } 130 else 131 { 132 return IV_FAIL; 133 } 134} 135