Files
2026-08-24 10:03:24 +08:00

84 lines
1.8 KiB
C++

/*
* Copyright (c) 2021 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:
*/
#ifndef AML_MP_DSC_DEV_H_
#define AML_MP_DSC_DEV_H_
#include <stdio.h>
#include "AmlMpDscCa.h"
namespace aml_mp {
#ifdef __cplusplus
extern "C" {
#endif
#include <libdsm.h>
#define AML_MP_INVALID_DSC_HANDLE (-1)
typedef struct {
int mDsmFd;
int dev_no; //demuxId
int mediacasSessionId;
uint32_t vid; // video pid
uint32_t aid[8]; // audio pid
int vdsc_handle;
int adsc_handle[8];
uint32_t mDscType;
uint32_t mDscAlgo;
struct dsm_keyslot_list mKeyslotList;
bool hasAllocDscChannels;
bool isDvrRecord;
long reserved[8];
} Aml_MP_MediaCasDsmParams;
#define CA_DSC_ERROR -1
#define CA_DSC_OK 0
int ca_init();
int ca_open(int devno);
int ca_alloc_chan(int devno, unsigned int pid, int algo, int dsc_type);
int ca_free_chan(int devno, int index);
int ca_set_key(int devno, int index, int parity, uint32_t key_index);
int ca_set_scb(int devno, int index, int scb, int scb_as_is);
int ca_close(int devno);
int caGetFd(int devno);
bool caSetDscChannelsKeyslot(Aml_MP_MediaCasDsmParams *mediacasDsmParams);
bool caFreeDscChannels(Aml_MP_MediaCasDsmParams *mediacasDsmParams);
bool caAllocDscChannels(Aml_MP_MediaCasDsmParams *mediacasDsmParams);
bool isDsmDecSlotReady(int dsmFd);
bool getKeySlots(int dsmFd, Aml_MP_MediaCasDsmParams *mediacasDsmParams);
bool caDsmOpenSession(int dev_no, int sessionId, int &dsmFd);
int caDsmCloseSession(Aml_MP_MediaCasDsmParams *mediacasDsmParams);
int CaClearMediacasDsmParamsState(Aml_MP_MediaCasDsmParams *mediacasDsmParams);
#ifdef __cplusplus
}
#endif
#endif
}