// Path: library/src/main/java/com/jwoolston/android/uvc/interfaces/VideoClassInterface.java
// public abstract class VideoClassInterface extends UvcInterface {
// 
//     VideoClassInterface(UsbInterface usbInterface, byte[] descriptor) {
//         super(usbInterface, descriptor);
//     }
// 
//     public static enum VC_INF_SUBTYPE {
//         VC_DESCRIPTOR_UNDEFINED(0x00),
//         VC_HEADER(0x01),
//         VC_INPUT_TERMINAL(0x02),
//         VC_OUTPUT_TERMINAL(0x03),
//         VC_SELECTOR_UNIT(0x04),
//         VC_PROCESSING_UNIT(0x05),
//         VC_EXTENSION_UNIT(0x06),
//         VC_ENCODING_UNIT(0x07);
// 
//         public final byte subtype;
// 
//         private VC_INF_SUBTYPE(int subtype) {
//             this.subtype = (byte) (subtype & 0xFF);
//         }
// 
//         public static VC_INF_SUBTYPE getSubtype(byte subtype) {
//             for (VC_INF_SUBTYPE s : VC_INF_SUBTYPE.values()) {
//                 if (s.subtype == subtype) {
//                     return s;
//                 }
//             }
//             return null;
//         }
//     }
// }


import com.jwoolston.android.uvc.interfaces.VideoClassInterface;
package com.jwoolston.android.uvc.interfaces.terminals;


/**
 * @author Jared Woolston (Jared.Woolston@gmail.com)
 */
public abstract class VideoTerminal {

    protected static final int bLength            = 0;
    protected static final int bDescriptorType    = 1;
    protected static final int bDescriptorSubtype = 2;
    protected static final int bTerminalID        = 3;
    protected static final int wTerminalType      = 4;
    protected static final int bAssocTerminal     = 6;

    private final TerminalType terminalType;
    private final int          terminalID;
    private final int          associatedTerminalID;

    public static boolean isVideoTerminal(byte[] descriptor) {
// Path: library/src/main/java/com/jwoolston/android/uvc/interfaces/VideoClassInterface.java
// public abstract class VideoClassInterface extends UvcInterface {
// 
//     VideoClassInterface(UsbInterface usbInterface, byte[] descriptor) {
//         super(usbInterface, descriptor);
//     }
// 
//     public static enum VC_INF_SUBTYPE {
//         VC_DESCRIPTOR_UNDEFINED(0x00),
//         VC_HEADER(0x01),
//         VC_INPUT_TERMINAL(0x02),
//         VC_OUTPUT_TERMINAL(0x03),
//         VC_SELECTOR_UNIT(0x04),
//         VC_PROCESSING_UNIT(0x05),
//         VC_EXTENSION_UNIT(0x06),
//         VC_ENCODING_UNIT(0x07);
// 
//         public final byte subtype;
// 
//         private VC_INF_SUBTYPE(int subtype) {
//             this.subtype = (byte) (subtype & 0xFF);
//         }
// 
//         public static VC_INF_SUBTYPE getSubtype(byte subtype) {
//             for (VC_INF_SUBTYPE s : VC_INF_SUBTYPE.values()) {
//                 if (s.subtype == subtype) {
//                     return s;
//                 }
//             }
//             return null;
//         }
//     }
// }


// Path: library/src/main/java/com/jwoolston/android/uvc/interfaces/terminals/VideoTerminal.java
import com.jwoolston.android.uvc.interfaces.VideoClassInterface;

package com.jwoolston.android.uvc.interfaces.terminals;


/**
 * @author Jared Woolston (Jared.Woolston@gmail.com)
 */
public abstract class VideoTerminal {

    protected static final int bLength            = 0;
    protected static final int bDescriptorType    = 1;
    protected static final int bDescriptorSubtype = 2;
    protected static final int bTerminalID        = 3;
    protected static final int wTerminalType      = 4;
    protected static final int bAssocTerminal     = 6;

    private final TerminalType terminalType;
    private final int          terminalID;
    private final int          associatedTerminalID;

    public static boolean isVideoTerminal(byte[] descriptor) {
        return (descriptor[bDescriptorSubtype] == VideoClassInterface.VC_INF_SUBTYPE.VC_INPUT_TERMINAL.subtype ||