// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/sender/rtmp/packets/Chunk.java
// public abstract class Chunk {
//      
//     protected ChunkHeader header;
// 
//     public Chunk(ChunkHeader header) {
//         this.header = header;
//     }
// 
//     public ChunkHeader getChunkHeader() {
//         return header;
//     }
//     
//     public abstract void readBody(InputStream in) throws IOException;    
//     
//     protected abstract void writeBody(OutputStream out) throws IOException;
//            
//     public void writeTo(OutputStream out, final SessionInfo sessionInfo) throws IOException {
//         int chunkSize = sessionInfo.getTxChunkSize();
//         ByteArrayOutputStream baos = new ByteArrayOutputStream();
//         writeBody(baos);        
//         byte[] body = baos.toByteArray();        
//         header.setPacketLength(body.length);
//         // Write header for first chunk
//         header.writeTo(out, ChunkType.TYPE_0_FULL, sessionInfo);
//         int remainingBytes = body.length;
//         int pos = 0;
//         while (remainingBytes > chunkSize) {
//             // Write packet for chunk
//             out.write(body, pos, chunkSize);
//             remainingBytes -= chunkSize;
//             pos += chunkSize;
//             // Write header for remain chunk
//             header.writeTo(out, ChunkType.TYPE_3_NO_BYTE, sessionInfo);
//         }
//         out.write(body, pos, remainingBytes);
//     }
// }


import org.yeshen.video.librtmp.unstable.net.sender.rtmp.packets.Chunk;
package org.yeshen.video.librtmp.unstable.net;


/*********************************************************************
 * Created by yeshen on 2017/05/21.
 * Copyright (c) 2017 yeshen.org. - All Rights Reserved
 *********************************************************************/


public class Frame {
    public static final int FRAME_TYPE_AUDIO = 1;
    public static final int FRAME_TYPE_KEY_FRAME = 2;
    public static final int FRAME_TYPE_INTER_FRAME = 3;
    public static final int FRAME_TYPE_CONFIGURATION = 4;

    public Chunk data;
    public int packetType;
    public int frameType;

// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/sender/rtmp/packets/Chunk.java
// public abstract class Chunk {
//      
//     protected ChunkHeader header;
// 
//     public Chunk(ChunkHeader header) {
//         this.header = header;
//     }
// 
//     public ChunkHeader getChunkHeader() {
//         return header;
//     }
//     
//     public abstract void readBody(InputStream in) throws IOException;    
//     
//     protected abstract void writeBody(OutputStream out) throws IOException;
//            
//     public void writeTo(OutputStream out, final SessionInfo sessionInfo) throws IOException {
//         int chunkSize = sessionInfo.getTxChunkSize();
//         ByteArrayOutputStream baos = new ByteArrayOutputStream();
//         writeBody(baos);        
//         byte[] body = baos.toByteArray();        
//         header.setPacketLength(body.length);
//         // Write header for first chunk
//         header.writeTo(out, ChunkType.TYPE_0_FULL, sessionInfo);
//         int remainingBytes = body.length;
//         int pos = 0;
//         while (remainingBytes > chunkSize) {
//             // Write packet for chunk
//             out.write(body, pos, chunkSize);
//             remainingBytes -= chunkSize;
//             pos += chunkSize;
//             // Write header for remain chunk
//             header.writeTo(out, ChunkType.TYPE_3_NO_BYTE, sessionInfo);
//         }
//         out.write(body, pos, remainingBytes);
//     }
// }


// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
import org.yeshen.video.librtmp.unstable.net.sender.rtmp.packets.Chunk;

package org.yeshen.video.librtmp.unstable.net;


/*********************************************************************
 * Created by yeshen on 2017/05/21.
 * Copyright (c) 2017 yeshen.org. - All Rights Reserved
 *********************************************************************/


public class Frame {
    public static final int FRAME_TYPE_AUDIO = 1;
    public static final int FRAME_TYPE_KEY_FRAME = 2;
    public static final int FRAME_TYPE_INTER_FRAME = 3;
    public static final int FRAME_TYPE_CONFIGURATION = 4;

    public Chunk data;
    public int packetType;
    public int frameType;

    public Frame(Chunk data, int packetType, int frameType) {