package kr.co.icontrols.ilp300_700.call;

import android.content.Context;
import android.util.Log;
import android.view.Surface;

import kr.co.icontrols.V40IFCCD.V40IFCCD;
import kr.co.icontrols.ilp300_700.USBCameraActivity2;

public class VideoJNI {

    String TAG = "VideoJNI";

    Context mContext;

    V40IFCCD mV40IFCCD;

    public VideoJNI(Context context) {
        Log.d(TAG, "=========== [VideoJNI] ===========");
        mContext = context;
        mV40IFCCD = new V40IFCCD(mContext);
    }

    public void setCameraSelect() {
        mV40IFCCD.setCameraSelect();
    }

    public void setCheckIFrame(boolean bSet) {
        mV40IFCCD.setCheckIFrame(bSet);
    }

    public void setCameraSurface(Surface CameraSurface, int nWidth, int nHeight, int nBitRate, int nFrameRate) {
        //mV40IFCCD.setCameraSurface(CameraSurface, nWidth, nHeight, nBitRate, nFrameRate);
    }

    public void encoderStartOperation() {
        //mV40IFCCD.encoderStartOperation();

    }

    public void encoderStopOperation() {

        //mV40IFCCD.encoderStopOperation();
    }

    boolean bDecoderStarted = false;

    public void decoderStartOperation() {
        if (!bDecoderStarted) {
            bDecoderStarted = true;
            mV40IFCCD.decoderStartOperation();
        }
    }

    public void decoderStopOperation() {
        if (bDecoderStarted) {
            bDecoderStarted = false;
            mV40IFCCD.decoderStopOperation();
        }
    }

    public void sendDataToDecoder(byte[] hData, int nHeaderLen, int nFrameLen, int nTimeStamp) {
        mV40IFCCD.sendDataToDecoder(hData, nHeaderLen, nFrameLen, nTimeStamp);
    }
}
