50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2014 Amlogic, Inc. All rights reserved.
|
|
*
|
|
* This source code is subject to the terms and conditions defined in the
|
|
* file 'LICENSE' which is part of this source code package.
|
|
*
|
|
* Description: header file
|
|
*/
|
|
|
|
#ifndef _CTVAUDIO_H
|
|
#define _CTVAUDIO_H
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <hardware/audio.h>
|
|
#include <system/audio.h>
|
|
|
|
/*
|
|
typedef enum tv_path_status_e {
|
|
TV_PATH_STATUS_NO_DEV = -2,
|
|
TV_PATH_STATUS_ERROR = -1,
|
|
TV_PATH_STATUS_INACTIVE = 0,
|
|
TV_PATH_STATUS_ACTIVE = 1,
|
|
TV_PATH_STATUS_MAX,
|
|
} tv_path_status_t;
|
|
*/
|
|
|
|
class CTvAudio {
|
|
public:
|
|
static CTvAudio *getInstance();
|
|
void create_audio_patch(int channel, int device_type);
|
|
void release_audio_patch(int channel);
|
|
void set_audio_av_mute(bool mute);
|
|
void set_audio_decoder_id(int channel, int id);
|
|
void set_audio_av_audio_only_enabled(bool enable);
|
|
private:
|
|
struct audio_port_config source;
|
|
struct audio_port_config sink;
|
|
audio_patch_handle_t patch_handle;
|
|
audio_patch_handle_t sub_patch_handle;
|
|
audio_hw_device_t *device;
|
|
bool iSInit;
|
|
static CTvAudio *mInstance;
|
|
int main_id;
|
|
int sub_id;
|
|
CTvAudio();
|
|
~CTvAudio();
|
|
};
|
|
#endif |