package a.c.b;

import com.ucar.databus.proto.UCarProto;
import java.nio.ByteBuffer;
import java.util.HashMap;

public class w extends v {

    public class a extends HashMap<Integer, String> {
        public a() {
            put(1, "ip_call");
            put(2, "modem_call");
            put(3, "ai_assistant");
            put(4, "ring");
            put(5, "notification");
            put(6, "tts");
            put(7, "system");
            put(10, "num");
            put(9, "microphone");
            put(0, "undefined");
        }
    }

    public class b extends HashMap<Integer, String> {
        public b() {
            put(3, "camera_preview");
            put(4, "camera_picture");
        }
    }

    public static s a(ByteBuffer byteBuffer, UCarProto.AudioType audioType) {
        s s = s.s();
        s.g().a(byteBuffer.remaining() + 20, f.RAW, i.SEND, c.AUDIO, audioType.getNumber());
        s.b(byteBuffer);
        return s;
    }

    public static s a(ByteBuffer byteBuffer, UCarProto.VideoType videoType) {
        s s = s.s();
        s.g().a(byteBuffer.remaining() + 20, f.RAW, i.SEND, c.VIDEO, videoType.getNumber());
        s.b(byteBuffer);
        return s;
    }

    public static s a(ByteBuffer byteBuffer, UCarProto.VideoType videoType, short s) {
        s a2 = s.r().a(f.RAW).a(c.VIDEO).a(videoType.getNumber()).a(v.a()).a(byteBuffer);
        a2.g().a(s);
        return a2;
    }

    public static s a(byte[] bArr, UCarProto.AudioType audioType) {
        return s.r().a(f.RAW).a(c.AUDIO).a(audioType.getNumber()).a(v.a()).a(bArr);
    }

    public static void b() {
        v.a(c.AUDIO, new a());
        v.a(c.VIDEO, new b());
    }

    public static boolean b(s sVar) {
        return sVar.q() && sVar.f() == c.AUDIO;
    }

    public static boolean c(s sVar) {
        return sVar.q() && sVar.f() == c.VIDEO;
    }

    public static byte[] d(s sVar) {
        v.a(f.RAW, c.AUDIO, -1, sVar);
        return sVar.d();
    }

    public static UCarProto.AudioType e(s sVar) {
        v.a(f.RAW, c.AUDIO, -1, sVar);
        return UCarProto.AudioType.forNumber(sVar.j());
    }

    public static short f(s sVar) {
        return sVar.l();
    }

    public static byte[] g(s sVar) {
        v.a(f.RAW, c.VIDEO, -1, sVar);
        return sVar.d();
    }

    public static UCarProto.VideoType h(s sVar) {
        v.a(f.RAW, c.VIDEO, -1, sVar);
        return UCarProto.VideoType.forNumber(sVar.j());
    }
}
