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 
31 #include "util/u_debug.h"
32 
33 #include "va_private.h"
34 
35 VAStatus
vlVaQueryConfigProfiles(VADriverContextP ctx,VAProfile * profile_list,int * num_profiles)36 vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list, int *num_profiles)
37 {
38    if (!ctx)
39       return VA_STATUS_ERROR_INVALID_CONTEXT;
40 
41    int i = 0;
42 
43    profile_list[i++] = VAProfileMPEG2Simple;
44    *num_profiles = i;
45 
46    return VA_STATUS_SUCCESS;
47 }
48 
49 
50 VAStatus
vlVaQueryConfigEntrypoints(VADriverContextP ctx,VAProfile profile,VAEntrypoint * entrypoint_list,int * num_entrypoints)51 vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,
52                            VAEntrypoint *entrypoint_list, 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       entrypoint_list[0] = VAEntrypointMoComp;
64       *num_entrypoints = 1;
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 VAStatus
vlVaGetConfigAttributes(VADriverContextP ctx,VAProfile profile,VAEntrypoint entrypoint,VAConfigAttrib * attrib_list,int num_attribs)85 vlVaGetConfigAttributes(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
86                         VAConfigAttrib *attrib_list, int num_attribs)
87 {
88    if (!ctx)
89       return VA_STATUS_ERROR_INVALID_CONTEXT;
90 
91    return VA_STATUS_ERROR_UNIMPLEMENTED;
92 }
93 
94 VAStatus
vlVaCreateConfig(VADriverContextP ctx,VAProfile profile,VAEntrypoint entrypoint,VAConfigAttrib * attrib_list,int num_attribs,VAConfigID * config_id)95 vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
96                  VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
97 {
98    if (!ctx)
99       return VA_STATUS_ERROR_INVALID_CONTEXT;
100 
101    return VA_STATUS_ERROR_UNIMPLEMENTED;
102 }
103 
104 VAStatus
vlVaDestroyConfig(VADriverContextP ctx,VAConfigID config_id)105 vlVaDestroyConfig(VADriverContextP ctx, VAConfigID config_id)
106 {
107    if (!ctx)
108       return VA_STATUS_ERROR_INVALID_CONTEXT;
109 
110    return VA_STATUS_ERROR_UNIMPLEMENTED;
111 }
112 
113 VAStatus
vlVaQueryConfigAttributes(VADriverContextP ctx,VAConfigID config_id,VAProfile * profile,VAEntrypoint * entrypoint,VAConfigAttrib * attrib_list,int * num_attribs)114 vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile *profile,
115                           VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
116 {
117    if (!ctx)
118       return VA_STATUS_ERROR_INVALID_CONTEXT;
119 
120    return VA_STATUS_ERROR_UNIMPLEMENTED;
121 }
122