Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I have requirement as follows:

If it is file name, then first check the extension. If there is no extension, then read the file data and analyze it to determine if it is MIDI, QCP, PMD or MP3 format.

 

how is it possible in brew mobile? if yes please provide me some code. Also would this device dependent?

Appreciate your help.

Use ISHELL_DetectType() and ISHELL_GetHandler().
Refer API reference for more details.

Use ISHELL_DetectType() and ISHELL_GetHandler().
Refer API reference for more details.

Use ISHELL_DetectType() and ISHELL_GetHandler().
Refer API reference for more details.

Use ISHELL_DetectType() and ISHELL_GetHandler().
Refer API reference for more details.

worked fine, thank you

worked fine, thank you

I have one more question, how can i write media format independent code which can be generic because my application has to play files in a list of different format.

I have one more question, how can i write media format independent code which can be generic because my application has to play files in a list of different format.

 
 
u can u IMEDIAUTIL_CreateMedia().
Using IMEDIAUTIL_CreateMedia() utility function (provided in AEEMediaUtil.c), that analyzes the media data, detects the media data type (which is its MIME), gets the registered class ID for that MIME (with AEECLSID_MEDIA as base class) and creates the IMedia Interface object.

 
 
IMEDIAUTIL_CreateMedia() puts IMedia Interface object in Ready state.

 
 
u can u IMEDIAUTIL_CreateMedia().
Using IMEDIAUTIL_CreateMedia() utility function (provided in AEEMediaUtil.c), that analyzes the media data, detects the media data type (which is its MIME), gets the registered class ID for that MIME (with AEECLSID_MEDIA as base class) and creates the IMedia Interface object.

 
 
IMEDIAUTIL_CreateMedia() puts IMedia Interface object in Ready state.

IMEDIAUTIL_CreateMedia(), this function analyzes media data and creates an IMedia-based object
if pmd->clsData is MMD_FILE_NAME, then:
(1) The file extension is checked to see if any IMedia class is registered for the extension.
(2) If not, the file is opened and file contents are read. Using ISHELL_DetectType(), the MIME of the media data is determined and IMedia class is found from Shell registry.
If pmd->clsData is MMD_BUFFER, then:
(1) The buffer contents are analyzed using ISHELL_DetectType() to determine the MIME of the media data is determined and IMedia class is found from Shell registry.
If pmd->clsData is MMD_ISOURCE, then
(1) The caller needs to set pmd->pData to IPeek *.
(2) This function peeks for the data to see if enough data is available. The buffer contents are analyzed using ISHELL_DetectType(), the MIME of the media data is determined and IMedia class is found from Shell registry.
(3) If enough data is not there, then it calls IPEEK_Peek() requesting required number of bytes. If IPEEK_Peek() returns IPEEK_WAIT, then it returns ENEEDMORE. In response to this, caller needs to call IPEEK_Peekable(). After the data becomes available, caller should call this function again to create IMedia object.
If IMedia class is found, then IMedia object is created and media data is set. This puts IMedia object in ready state.

IMEDIAUTIL_CreateMedia(), this function analyzes media data and creates an IMedia-based object
if pmd->clsData is MMD_FILE_NAME, then:
(1) The file extension is checked to see if any IMedia class is registered for the extension.
(2) If not, the file is opened and file contents are read. Using ISHELL_DetectType(), the MIME of the media data is determined and IMedia class is found from Shell registry.
If pmd->clsData is MMD_BUFFER, then:
(1) The buffer contents are analyzed using ISHELL_DetectType() to determine the MIME of the media data is determined and IMedia class is found from Shell registry.
If pmd->clsData is MMD_ISOURCE, then
(1) The caller needs to set pmd->pData to IPeek *.
(2) This function peeks for the data to see if enough data is available. The buffer contents are analyzed using ISHELL_DetectType(), the MIME of the media data is determined and IMedia class is found from Shell registry.
(3) If enough data is not there, then it calls IPEEK_Peek() requesting required number of bytes. If IPEEK_Peek() returns IPEEK_WAIT, then it returns ENEEDMORE. In response to this, caller needs to call IPEEK_Peekable(). After the data becomes available, caller should call this function again to create IMedia object.
If IMedia class is found, then IMedia object is created and media data is set. This puts IMedia object in ready state.