18045010223
7 天以前 afe371d39a054b2f2a9e5875b945584eec8a8141
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package cn.org.hentai.jtt1078.flv;
 
//由于flv格式是header+body,而body是preTagSize+currentTagData.......循环形式,并且第一个的preTagSize始终为0,
// 与其这样不如采用(header+preTag0Size)+(currentTagData+currentTagSize),这样就避免每次都要记录以下上一个tag的数据大小。
/**
 * author:zhouyili (11861744@qq.com)
 */
public class FlvTag {
    public static final int AUDIO = 8;
    public static final int VIDEO = 9;
    public static final int SCRIPT = 18;//0x12
    private int preTagSize;
    private byte tagType;
    /**3个字节 streamId以后的数据长度*/
    private int tagDataSize;
    //低3个字节写入后再写高位字节,相对于第一帧的时间偏移量,单位ms
    private int offSetTimestamp;
    //3个字节,一般总是0
    private int streamId;
 
    public FlvTag() {
    }
 
    public FlvTag(int offSetTimestamp, int tagDataSize) {
        this.tagDataSize = tagDataSize;
        this.offSetTimestamp = offSetTimestamp;
    }
 
    public int getPreTagSize() {
        return preTagSize;
    }
 
    public void setPreTagSize(int preTagSize) {
        this.preTagSize = preTagSize;
    }
 
    public byte getTagType() {
        return tagType;
    }
 
    public void setTagType(byte tagType) {
        this.tagType = tagType;
    }
 
    public int getTagDataSize() {
        return tagDataSize;
    }
 
    public void setTagDataSize(int tagDataSize) {
        this.tagDataSize = tagDataSize;
    }
 
    public int getOffSetTimestamp() {
        return offSetTimestamp;
    }
 
    public void setOffSetTimestamp(int offSetTimestamp) {
        this.offSetTimestamp = offSetTimestamp;
    }
 
    public int getStreamId() {
        return streamId;
    }
 
    public void setStreamId(int streamId) {
        this.streamId = streamId;
    }
}