Supplement of network player

zhaozj2021-02-11  233

This is mainly supplemented with the data processing section. Because some friends and I discuss these problems, it is indeed a problem. So after I test, I will unify it to give you a look. Because my project also embeds into the network part. So I wrote some code I know that I know and learn directly from the file. The read and write of the file is fast, but the data requirements of the network are waiting. Not very timely. In particular, when processing head information. Because I did MPEG2, he handled the header information to be more than 1m, if the while waited. . . Exhausted - *% · - # .... # 下 下 介 下 详 详 详 详 详 详 情况 详 情况 详. 1. First, whether it is MPEG2 or MPEG1, he has to read 32768 bytes. This is used to determine the data format. 2. Secondly, if the correctness is correct (consistent with the type you give, for MPEG1 32768, then read 32768, the data can be data in the middle of the file. For MPEG2 format, he wants to read more than 1m, then read a few hundred k data. These data can also start from the middle of the file. Or the time data stream data is also linear. That is to say, these data is not related to judgment. This should know how to do it ...

3. Finally, it is stable reading data. MPEG1 is 32768, MPEG2 is 1638. Then I have said how to modify the data size of the MPEG1 format. However, it can only be 2 N times. However, it is required to modify the base class. In the following I will explain a simpler change method. And it can be any size (only less than the default). But still finish this part.

So, starting 32768 is a key data. If it is not able to judge information, it will read 32768 data. I have been reading until it correctly judges the data format. Conclusion: Give a correct data at the beginning. Improvement: Since he will constantly judge (do not know if MPEG1 is, I test is MPEG2, you can measure it yourself), so you can start it in the right data! (For this reason, everyone can get rid of the head of the head information, it is really too ... 嘿嘿) As long as you give the data, it is correct. Then it will follow 2. The steps start running down. However, since I tested MPEG2 format MediaSubtype_mpeg2_transport and MediaSubtype_mpeg2_program, they were based on streaming, so I didn't act if MPEG1 is like this. Is it necessary to be a header information. (I wanted to test, but my test program ... 555 ~~~~ Where to go, God, when to delete ...), I want everyone to see, so I have not tested. I hope to try MPEG1. The data processing started above. Below you will say 3 steps. This also solves the problem of the While blocking thread. One fell again. I just said that playing data can be arbitrary, now explain it. Can only be less than the default, it should be greater than, but is you willing? The original read function can be returned in advance! ! ! No need to return to the data. Like the code below: * pdwbytesread = 0; return s_ok; so you don't give data. However, the first data cannot return 0. Otherwise it will over. Then, because the size of many people's data packets are ourselves, if your data does not meet the 32768 or 1638 of him, it is no match, what should I do? Then you copy your requirements for the size of the data to PBBuffer, then, you return your own size to OK. Like the code below:

CopyMemory (PVOID) (pvoid) (M_PBData M_Head), my_sock_size); * pdwbytesread = my_sock_size; return s_ok; how do you feel? ? Still trying! Go! As for the test code ... Hey, I also want to give it. - # *% ... · #% · It seems that everyone is still writing. If you have changed it, it should be very simple. The code is a few words. I wish you all good luck! Happy holiday! !

Afterain 9.28

转载请注明原文地址:https://www.9cbs.com/read-4310.html

New Post(0)