1. function description
Description of encrypted files supported by the player parsing library
2. Docking instructions
2.1 involves interfaces
AVFILE_API int APICALL AVFILE_FEOpenFile( const char *szFileName, int nChn, AVFILEPassword_S* pPwd, int nPwdNum, BOOL bCheckPwd, LONG_PTR* lpFileHandle)
2.2 password structure
typedef struct _tagAVFILEPassword_S
{
char szPwd[36]; // password entered by the user
int nReserve;
} AVFILEPassword_S;
2.3 Error Code Definition
// 1 is S_FALSE, the error number must be incremented from 2
Define AVFILE_ERR_PASSWORD 2 // Password Error
2.4 search and preview
1.bCheckPwd: FALSE, indicating that the password is not checked
2. The parsing library should ignore the password. If a non - 0 value is returned, processing is not supported by format.
3. If you don't want to return the data, you can record the sign that the password has not been entered, and you can read the frame without returning the data (note: there will be no preview picture)
2.5 Playback
1.bCheckPwd: pass TRUE, verify the password, add for to judge the incoming pPwd password, nPwdNum is the number of passwords (note: currently only one password is supported)
2. If the password is incorrect, return the error code AVFILE_ERR_PASSWORD
3. A dialog box will pop up to enter the password and let the user change the password.
4. When the password is correct, return 0 to start playing
When double- clicking a file to play
↓
↓ bCheckPwd pass TRUE, verify password
↓pPwd is the password, nPwdNum is the number of passwords (note: currently only 1 password is supported)
↓
- - - > File AVFILE_FEOpenFile
↑ ↓
↑ ↓
↑ ↓
Write whether the file is encrypted- > the file is not encrypted- > return 0, open successfully
↑ ↓
↑ ↓
↑ ↓
↑ File Encryption
↑ ↓
↑ ↓
↑ ↓
↑ Check whether the password is correct- > password is correct- > return 0, open successfully
↑ ↓
↑ ↓
↑ ↓
Wrong password (return AVFILE_ERR_PASSWORD)
↑ ↓
↑ ↓
↑ ↓
↑ Pop- up password input window- > close password box- > open failed
↑ ↓
↑ ↓
↑ ↓
<- - - Enter the password and confirm