// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// 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) {
//         this.data = data;
//         this.packetType = packetType;
//         this.frameType = frameType;
//     }
// }
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/tools/Lg.java
// public class Lg {
// 
//     private static final String TAG = Lg.class.getSimpleName();
// 
//     public static void e(@Nullable String value) {
//         Log.e(TAG, value);
//     }
// 
//     public static void e(@Nullable Exception value) {
//         Log.e(TAG, Error.UN_KNOW);
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void e(@NonNull String msg, @Nullable Exception value) {
//         Log.e(TAG, msg);
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void d(@Nullable String value) {
//         Log.d(TAG, value);
//     }
// 
//     public static void d(@Nullable Exception value) {
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void d(@NonNull String msg, @Nullable String value) {
//         Log.d(TAG, msg + " >> " + value);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_AUDIO = 1;
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_INTER_FRAME = 3;
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_KEY_FRAME = 2;


import org.yeshen.video.librtmp.unstable.net.Frame;
import org.yeshen.video.librtmp.unstable.tools.Lg;
import java.util.ArrayList;
import java.util.Locale;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_AUDIO;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_INTER_FRAME;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_KEY_FRAME;
                    String strLog = "";
                    for (int i = 0; i < SCAN_MAX_TIME; i++) {
                        int dif = mScanSnapShotList.get(i).outCount - mScanSnapShotList.get(i).inCount;
                        if (dif < 0) {
                            negativeCounter++;
                        }
                        averageDif += dif;
                        strLog = strLog + String.format(Locale.CHINA, "n%d:%d  ", i, dif);
                    }
                    Lg.d(strLog);
                    if (negativeCounter >= 4 || averageDif < -100) {
                        //坏
                        Lg.d("Bad Send Speed.");
                        if (mSendQueueListener != null) {
                            mSendQueueListener.bad();
                        }
                    } else {
                        //好
                        Lg.d("Good Send Speed.");
                        if (mSendQueueListener != null) {
                            mSendQueueListener.good();
                        }
                    }
                    //清空
                    mScanSnapShotList.clear();
                    mCurrentScanTime = 0;
                }
                mScanSnapShotList.add(new ScanSnapShot(mInFrameCount.get(), mOutFrameCount.get()));
                mInFrameCount.set(0);
                mOutFrameCount.set(0);
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// 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) {
//         this.data = data;
//         this.packetType = packetType;
//         this.frameType = frameType;
//     }
// }
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/tools/Lg.java
// public class Lg {
// 
//     private static final String TAG = Lg.class.getSimpleName();
// 
//     public static void e(@Nullable String value) {
//         Log.e(TAG, value);
//     }
// 
//     public static void e(@Nullable Exception value) {
//         Log.e(TAG, Error.UN_KNOW);
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void e(@NonNull String msg, @Nullable Exception value) {
//         Log.e(TAG, msg);
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void d(@Nullable String value) {
//         Log.d(TAG, value);
//     }
// 
//     public static void d(@Nullable Exception value) {
//         if (value == null) return;
//         value.printStackTrace();
//     }
// 
//     public static void d(@NonNull String msg, @Nullable String value) {
//         Log.d(TAG, msg + " >> " + value);
//     }
// 
// 
// }
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_AUDIO = 1;
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_INTER_FRAME = 3;
// 
// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/Frame.java
// public static final int FRAME_TYPE_KEY_FRAME = 2;


// Path: app/src/main/java/org/yeshen/video/librtmp/unstable/net/sender/sendqueue/NormalSendQueue.java
import org.yeshen.video.librtmp.unstable.net.Frame;
import org.yeshen.video.librtmp.unstable.tools.Lg;
import java.util.ArrayList;
import java.util.Locale;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.atomic.AtomicInteger;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_AUDIO;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_INTER_FRAME;
import static org.yeshen.video.librtmp.unstable.net.Frame.FRAME_TYPE_KEY_FRAME;

                    String strLog = "";
                    for (int i = 0; i < SCAN_MAX_TIME; i++) {
                        int dif = mScanSnapShotList.get(i).outCount - mScanSnapShotList.get(i).inCount;
                        if (dif < 0) {
                            negativeCounter++;
                        }
                        averageDif += dif;
                        strLog = strLog + String.format(Locale.CHINA, "n%d:%d  ", i, dif);
                    }
                    Lg.d(strLog);
                    if (negativeCounter >= 4 || averageDif < -100) {
                        //坏
                        Lg.d("Bad Send Speed.");
                        if (mSendQueueListener != null) {
                            mSendQueueListener.bad();
                        }
                    } else {
                        //好
                        Lg.d("Good Send Speed.");
                        if (mSendQueueListener != null) {
                            mSendQueueListener.good();
                        }
                    }
                    //清空
                    mScanSnapShotList.clear();
                    mCurrentScanTime = 0;
                }
                mScanSnapShotList.add(new ScanSnapShot(mInFrameCount.get(), mOutFrameCount.get()));
                mInFrameCount.set(0);
                mOutFrameCount.set(0);
                mCurrentScanTime++;