---
# System prepended metadata

title: TCH ddi_sf_Function

---

# TCH ddi_sf_Function
## 1. _DDI_SF_SectionAvailableCallback
```
_DDI_SF_SectionAvailableCallback(CORBA_Object hCompObj, AMP_PORT_IO ePortIo, UINT32 uiPortIdx, AMP_BD_HANDLE hBD, void *pUserData)
 * @param hCompObj [in]
 * @param ePortIo [in]
 * @param uiPortIdx [in]
 * @param hBD [in]
 * @param pUserData [in]
 * @return if succeeded - SUCCESS, else
```
### Requirements :
- Realtek SDK must support registration of callback function related to SectionFilter operation.

- Please provide specific function that can register a callback function.
- And I would like to refer to Realtek's comments and examples for what should be done in the callback function.

### Description :
- It is mentioned that the existing implementation is implemented in Secure memory.
- I am not sure if this Secure Memory has anything to do with TEE/DRM.
- Please comment about what Secure memory means generally in Section Filter concept.
and please help to let me know whether Realtek SDK has the similar memory as secure memory that the existing code has.
### Need more :
- A:just assambled in secure memory,finnaly,the upper layer can asscess it in normal memory

## 2. _DDI_SF_PushBD
```
static HRESULT _DDI_SF_PushBD(BOOLEAN bSecureMemory, UINT32 filterId, CORBA_Object hCompObj, UINT32 uiPortIdx, AMP_BD_HANDLE hBD)
* @param bSecureMemory [in]
 * @param filterId [in]
 * @param hCompObj [in]
 * @param uiPortIdx [in]
 * @param hBD [in]
 * @return if succeeded - API_OK, else - API_ERROR
 ```
### usage example :
- Existing code supported the following 2 modes, which may not be considered on Realtek SDK.
- DATA_EXPORTER_PushBD is the case for secure memory.
### Description :
- To return the buffer used by dmx or data_exporter
### Need more :
- The buffer will return with the callback and the address will change always. It is uncertain whether it can meet the requirements
- ==> In the POC stage, we would like to follow Realtek's guide. If only live playback works normally, we want to apply it to TCH Middleware with the current structure of Realtek SDK.
Please provide an example that fits the behavior of TCH API.
- //please refer to How to filte section data with rtk rtksdk(base on how to play iptv with rtk sdk).rtf

## 3 . static DDI_STATUS _DDI_SF_StopInbandSectionFilter
```
static DDI_STATUS _DDI_SF_StopInbandSectionFilter
(SF_SECTION_FILTER_T *pSectionFilter, BOOLEAN bNotifyEvent)

 * @param pSectionFilter [in]
 * @param bNotifyEvent [in]
 * @return if succeeded - API_OK, else - API_ERROR
```
### Requirements :
- This is the case of stopping the operation related to section filter.
- Please provide an example suitable for the operation of Realtek SDK.
- Existing code considered the case of using secure memory.
- TEE and DRM are excluded from POC.

## 4. DDI_STATUS _DDI_SF_ResumeInbandSectionFilter
```
static DDI_STATUS _DDI_SF_ResumeInbandSectionFilter
(SF_SECTION_FILTER_T *pSectionFilter, UINT32 timeoutDuration, SF_CALLBACK_T pfnCallback)

 * @param pSectionFilter [in|out]
 * @param timeoutDuration [in]
 * @param pfnCallback [in]
 * @return if succeeded - API_OK, else - API_ERROR
```
### Requirements :
- This is the case of resumming the operation related to section filter.
- Please provide an example suitable for the operation of Realtek SDK.
- Existing code considered the case of using secure memory.
- TEE and DRM are excluded from POC.
## 5. DDI_STATUS _DDI_SF_AddInbandSectionFilter
```
static DDI_STATUS _DDI_SF_AddInbandSectionFilter
(SF_SECTION_FILTER_T *pSectionFilter, UINT32 filterId, AMP_COMPONENT dmxObj, UINT32 pid, SF_MATCH_MASK_T *pMatchMask, SF_FILTER_MODE_T filterMode)

 * @param pSectionFilter [out]
 * @param filterId [in]
 * @param dmxObj [in]
 * @param pid [in]
 * @param pMatchMask [in]
 * @param filterMode [in]
 * @return if succeeded - API_OK, else - API_ERROR
```
### Requirements :
- This is the case of adding a section filter.
- All related settings must be set in TCH Middleware API.
- Please provide an example suitable for the operation of Realtek SDK.
Existing code considered the case of using secure memory.
- TEE and DRM are excluded from POC.
### Description :
- please help to check all properties of filterCfg variable.

## 6. _DDI_SF_FindInactiveSectionFilter
```
static DDI_STATUS _DDI_SF_FindInactiveSectionFilter
(UINT32 inbandFeIdx, AMP_COMPONENT dmxObj, UINT32 pid, SF_MATCH_MASK_T *pMatchMask, SF_FILTER_MODE_T filterMode, UINT32 *pInbandSlotIdx)

 * @param inbandFeIdx[in]
 * @param dmxObj [in]
 * @param pid [in]
 * @param pMatchMask [in]
 * @param filterMode [in]
 * @param pInbandSlotIdx [out]
 * @return if succeeded - API_OK, else - API_ERROR
```
### Requirements :
- The existing code has checked the following cases.
- If there are cases similar to the following cases in Realtek SDK, please provide related examples.

#### If the following cases do not need to be checked at the time the section filter is requested(by DDI_SF_RequestSection API), this function does not need to be supported.

```
if (pSectionFilter->bAllocated == TRUE
&& pSectionFilter->status == SF_STATUS_OFF
&& pSectionFilter->dmxObj == dmxObj
&& pSectionFilter->pid == pid
&& pSectionFilter->matchMask.tableId == pMatchMask->tableId
&& pSectionFilter->matchMask.tableIdMask == pMatchMask->tableIdMask
&& !memcmp(pSectionFilter->matchMask.positiveMatch, pMatchMask->positiveMatch, SF_SECTION_FILTER_LEN)
&& !memcmp(pSectionFilter->matchMask.positiveMask, pMatchMask->positiveMask, SF_SECTION_FILTER_LEN)
//&& !memcmp(pSectionFilter->matchMask.negativeMatch, pMatchMask->negativeMatch, SF_SECTION_FILTER_LEN)
&& !memcmp(pSectionFilter->matchMask.negativeMask, pMatchMask->negativeMask, SF_SECTION_FILTER_LEN)
&& pSectionFilter->filterMode == filterMode)
```

## 7. DDI_SF_RequestSection
```
DDI_STATUS DDI_SF_RequestSection
(SF_FILTER_INFO_T *pFilterInfo, SF_CALLBACK_T pfnCallback, UINT32 *pFilterId)
 * @param pFilterInfo [in]
 * @param pfnCallback [in]
 * @param pFilterId [out]
 * @return if succeeded - API_OK, else - API_ERROR
```
### Requirements :
- In this function, the _DDI_SF_FindInactiveSectionFilter API and so on are called.
- Please refer to the contents mentioned in _DDI_SF_FindInactiveSectionFilter and ask for your opinion. (If the related function is not needed in Realtek SDK, the _DDI_SF_FindInactiveSectionFilter function can be removed.)
- When a request for Section Filter(this function calling) occurs, please provide an example that should be done.
### Description :
- if need more info, please help to let me know it.
### Need more :
- Please provide more details on what the function do.
- ==> please help to review new updating about requirements.
- If it is enough to know what we do, please help to change color to Green.
//OK
- --> "ok" means this function can be supported by Realtek. Is it right ?
//please mark it green,we can implement it
