Flex&Air

Android 录制的视频封包flv

//Create video byte stream object

fis = receiver.getInputStream();
fillBuffer(buffer, 0, 4, fis); // 读取取客户端名字参数长度
int namelength = bytes2int(buffer);
System.out.println(“–client len—” + namelength);
fillBuffer(buffer, 0, namelength, fis);
String clientname = new String(buffer, 0, namelength);
System.out.println(namelength + “–clientname—” + clientname);
fillBuffer(buffer, 0, 4, fis); // 读取取H264参数长度
int headlength = bytes2int(buffer);
byte[] cdata = new byte[headlength];
fillBuffer(cdata, 0, headlength, fis);
//CDATA_PS.put(clientname, cdata);
FLV_PROPER.put(clientname, getFlvProperties(cdata));
try {
publisher = new TopicPublisher(clientname);
new Thread(new Distribution()).start();
} catch (Exception e) {
e.printStackTrace();
}