va_config.c revision 2b296ec77c2b95e7632b45100de5a0878ac2a294
1/************************************************************************** 2 * 3 * Copyright 2010 Thomas Balling Sørensen & Orasanu Lucian. 4 * All Rights Reserved. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the 8 * "Software"), to deal in the Software without restriction, including 9 * without limitation the rights to use, copy, modify, merge, publish, 10 * distribute, sub license, and/or sell copies of the Software, and to 11 * permit persons to whom the Software is furnished to do so, subject to 12 * the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the 15 * next paragraph) shall be included in all copies or substantial portions 16 * of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * 26 **************************************************************************/ 27 28#include <va/va.h> 29#include <va/va_backend.h> 30#include <util/u_debug.h> 31#include "va_private.h" 32 33VAStatus vlVaQueryConfigProfiles( VADriverContextP ctx, 34 VAProfile *profile_list, 35 int *num_profiles) 36{ 37 if (!ctx) 38 return VA_STATUS_ERROR_INVALID_CONTEXT; 39 40 int i = 0; 41 42 profile_list[i++] = VAProfileMPEG2Simple; 43 *num_profiles = i; 44 45 return VA_STATUS_SUCCESS; 46} 47 48 49VAStatus vlVaQueryConfigEntrypoints( VADriverContextP ctx, 50 VAProfile profile, 51 VAEntrypoint *entrypoint_list, 52 int *num_entrypoints) 53{ 54 if (!ctx) 55 return VA_STATUS_ERROR_INVALID_CONTEXT; 56 57 VAStatus vaStatus = VA_STATUS_SUCCESS; 58 59 switch (profile) { 60 case VAProfileMPEG2Simple: 61 case VAProfileMPEG2Main: 62 VA_INFO("Using profile %08x\n",profile); 63 *num_entrypoints = 1; 64 entrypoint_list[0] = VAEntrypointMoComp; 65 break; 66 67 case VAProfileH264Baseline: 68 case VAProfileH264Main: 69 case VAProfileH264High: 70 vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE; 71 *num_entrypoints = 0; 72 break; 73 74 default: 75 VA_ERROR("Unsupported profile %08x\n",profile); 76 vaStatus = VA_STATUS_ERROR_UNSUPPORTED_PROFILE; 77 *num_entrypoints = 0; 78 break; 79 } 80 81 return vaStatus; 82} 83 84 85VAStatus vlVaGetConfigAttributes( VADriverContextP ctx, 86 VAProfile profile, 87 VAEntrypoint entrypoint, 88 VAConfigAttrib *attrib_list, 89 int num_attribs) 90{ 91 if (!ctx) 92 return VA_STATUS_ERROR_INVALID_CONTEXT; 93 94 return VA_STATUS_ERROR_UNIMPLEMENTED; 95} 96 97VAStatus vlVaCreateConfig( VADriverContextP ctx, 98 VAProfile profile, 99 VAEntrypoint entrypoint, 100 VAConfigAttrib *attrib_list, 101 int num_attribs, 102 VAConfigID *config_id) 103{ 104 if (!ctx) 105 return VA_STATUS_ERROR_INVALID_CONTEXT; 106 107 return VA_STATUS_ERROR_UNIMPLEMENTED; 108} 109 110VAStatus vlVaDestroyConfig( VADriverContextP ctx, 111 VAConfigID config_id) 112{ 113 if (!ctx) 114 return VA_STATUS_ERROR_INVALID_CONTEXT; 115 116 return VA_STATUS_ERROR_UNIMPLEMENTED; 117} 118 119VAStatus vlVaQueryConfigAttributes( VADriverContextP ctx, 120 VAConfigID config_id, 121 VAProfile *profile, 122 VAEntrypoint *entrypoint, 123 VAConfigAttrib *attrib_list, 124 int *num_attribs) 125{ 126 if (!ctx) 127 return VA_STATUS_ERROR_INVALID_CONTEXT; 128 129 return VA_STATUS_ERROR_UNIMPLEMENTED; 130} 131 132