xref: /OK3568_Linux_fs/external/mpp/osal/windows/os_allocator.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright 2015 Rockchip Electronics Co. LTD
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #if defined(_WIN32)
18 #include "os_allocator.h"
19 #include "allocator_std.h"
20 
21 /*
22  * window only support MPP_BUFFER_TYPE_NORMAL
23  */
24 
os_allocator_get(os_allocator * api,MppBufferType type)25 MPP_RET os_allocator_get(os_allocator *api, MppBufferType type)
26 {
27     MPP_RET ret = MPP_OK;
28     switch (type) {
29     case MPP_BUFFER_TYPE_NORMAL :
30     case MPP_BUFFER_TYPE_ION :
31     case MPP_BUFFER_TYPE_V4L2 : {
32         *api = allocator_std;
33     } break;
34     default : {
35         ret = MPP_NOK;
36     } break;
37     }
38     return ret;
39 }
40 
41 #endif
42