1 /******************************************************************************
2  *
3  * Copyright (C) 2018 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 * \file ihevce_buffer_que_interface.h
23 *
24 * \brief
25 *    This file contains interface prototypes of Buffer Queue manager functions
26 *
27 * \date
28 *    18/09/2012
29 *
30 * \author
31 *    Ittiam
32 *
33 ******************************************************************************
34 */
35 
36 #ifndef _IHEVCE_BUFFER_QUE_INTERFACE_H_
37 #define _IHEVCE_BUFFER_QUE_INTERFACE_H_
38 
39 /*****************************************************************************/
40 /* Extern Function Declarations                                              */
41 /*****************************************************************************/
42 
43 /* Create APIs */
44 WORD32 ihevce_buff_que_get_num_mem_recs(void);
45 
46 WORD32 ihevce_buff_que_get_mem_recs(
47     iv_mem_rec_t *ps_mem_tab, WORD32 max_num_bufs_in_que, WORD32 i4_mem_space);
48 
49 void *ihevce_buff_que_init(iv_mem_rec_t *ps_mem_tab, WORD32 num_bufs_in_que, void **ppv_buff_ptrs);
50 
51 /* Process APIs */
52 void *ihevce_buff_que_get_free_buf(void *pv_buf_que, WORD32 *pi4_id);
53 
54 void *ihevce_buff_que_get_next_buf(void *pv_buf_que, WORD32 *pi4_id);
55 
56 void *ihevce_buff_que_get_next_reorder_buf(void *pv_buf_que, WORD32 *pi4_id);
57 
58 WORD32 ihevce_buff_que_set_buf_prod(void *pv_buf_que, WORD32 buf_id, WORD32 num_users);
59 /*!< Note :The manager assumes that once a buffer is requested from Q atleast
60  * one consumer will consume it. so num_uers should be 0 when buffer has only
61  * one consumer, In general num_users should be passed as MAX num
62  * consumers - 1 */
63 
64 WORD32 ihevce_buff_que_rel_buf(void *pv_buf_que, WORD32 buf_id);
65 
66 WORD32 ihevce_buff_que_get_active_bufs(void *pv_buf_que);
67 
68 WORD32 ihevce_buff_que_set_reorder_buf(void *pv_buf_que, WORD32 buf_id);
69 
70 void *ihevce_buff_que_get_buf(void *pv_buf_que, WORD32 i4_id);
71 
72 #endif /* _IHEVCE_BUFFER_QUE_INTERFACE_H_ */
73