Anand
08-01-2003, 03:32 AM
Hi,
There is a requirement to get the data from the socket to ISource and use that for IMEDIA_Play(). Can anyone tell, how we can identify, we read whole data from the Socket. As the ISOURCEUTIL_SourceFromSocket() returns either SUCCESS or ENOMEMORY, there is no way to find whether we read whole data from the socket or not.
While reading from the socket, in the first pass itself ISOURCEUTIL_SourceFromMemory() return SUCCESS. But when I try with ISOURCE_Read(), it returns some chunk.
So, I have coded in such a way that even the function ISOURCEUTIL_SourceFromMemory() returns SUCCESS again i am calling the callback function to read the data from the socket to source. In the second pass, the source collects data from the socket, which includes header information also. So, how I can identify whether the ISource has whole data or not.
I want to avoid buffering huge data which returns from the server (say one MP3 with size 5MB). So, I hope we can collect this entire data into ISource and then assign this to IMEDIA parameter as follows:
md.clsData = MMD_ISOURCE;
md.pData = pMe->ppias;
md.dwSize = 0;
IMEDIA_SetMediaData(pMe->m_pMedia, &md);
result = IMEDIA_Play(pMe->m_pMedia);
Please provide me an information to proceed further.
There is a requirement to get the data from the socket to ISource and use that for IMEDIA_Play(). Can anyone tell, how we can identify, we read whole data from the Socket. As the ISOURCEUTIL_SourceFromSocket() returns either SUCCESS or ENOMEMORY, there is no way to find whether we read whole data from the socket or not.
While reading from the socket, in the first pass itself ISOURCEUTIL_SourceFromMemory() return SUCCESS. But when I try with ISOURCE_Read(), it returns some chunk.
So, I have coded in such a way that even the function ISOURCEUTIL_SourceFromMemory() returns SUCCESS again i am calling the callback function to read the data from the socket to source. In the second pass, the source collects data from the socket, which includes header information also. So, how I can identify whether the ISource has whole data or not.
I want to avoid buffering huge data which returns from the server (say one MP3 with size 5MB). So, I hope we can collect this entire data into ISource and then assign this to IMEDIA parameter as follows:
md.clsData = MMD_ISOURCE;
md.pData = pMe->ppias;
md.dwSize = 0;
IMEDIA_SetMediaData(pMe->m_pMedia, &md);
result = IMEDIA_Play(pMe->m_pMedia);
Please provide me an information to proceed further.