1/*
2 *
3 * Copyright 2012 Samsung Electronics S.LSI Co. LTD
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/*
19 * @file        srp_api.h
20 * @brief
21 * @author      Yunji Kim (yunji.kim@samsung.com)
22 * @version     1.1.0
23 * @history
24 *   2012.02.28 : Create
25 */
26
27#ifndef __SRP_API_H__
28#define __SRP_API_H__
29
30#include "srp_ioctl.h"
31#include "srp_error.h"
32
33#define SRP_DEV_NAME                    "dev/srp"
34
35#define SRP_INIT_BLOCK_MODE             0
36#define SRP_INIT_NONBLOCK_MODE          1
37
38#define SRP_PENDING_STATE_RUNNING       0
39#define SRP_PENDING_STATE_PENDING       1
40
41struct srp_buf_info {
42    void *mmapped_addr;
43    void *addr;
44    unsigned int mmapped_size;
45    unsigned int size;
46    int num;
47};
48
49struct srp_dec_info {
50    unsigned int sample_rate;
51    unsigned int channels;
52};
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58int SRP_Create(int block_mode);
59int SRP_Init();
60int SRP_Decode(void *buff, int size_byte);
61int SRP_Send_EOS(void);
62int SRP_SetParams(int id, unsigned long val);
63int SRP_GetParams(int id, unsigned long *pval);
64int SRP_Deinit(void);
65int SRP_Terminate(void);
66int SRP_IsOpen(void);
67
68int SRP_Get_Ibuf_Info(void **addr, unsigned int *size, unsigned int *num);
69int SRP_Get_Obuf_Info(void **addr, unsigned int *size, unsigned int *num);
70int SRP_Get_Dec_Info(struct srp_dec_info *dec_info);
71int SRP_Get_PCM(void **addr, unsigned int *size);
72int SRP_Flush(void);
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif /*__SRP_API_H__ */
79