FileDocCategorySizeDatePackage
HdmiRecordSources.javaAPI DocAndroid 5.1 API29901Thu Mar 12 22:22:10 GMT 2015android.hardware.hdmi

HdmiRecordSources

public final class HdmiRecordSources extends Object
Container for record source used for one touch record. Use one of helper method by source type.
  • Own source: {@link #ofOwnSource()}
  • Digital service(channel id): {@link #ofDigitalChannelId(int, DigitalChannelData)}
  • Digital service(ARIB): {@link #ofArib(int, AribData)}
  • Digital service(ATSC): {@link #ofAtsc(int, AtscData)}
  • Digital service(DVB): {@link #ofDvb(int, DvbData)}
  • Analogue: {@link #ofAnalogue(int, int, int)}
  • External plug: {@link #ofExternalPlug(int)}
  • External physical address: {@link #ofExternalPhysicalAddress(int)}.
    hide

    Fields Summary
    private static final String
    TAG
    private static final int
    RECORD_SOURCE_TYPE_OWN_SOURCE
    Record source type for "Own Source".
    private static final int
    RECORD_SOURCE_TYPE_DIGITAL_SERVICE
    Record source type for "Digital Service".
    private static final int
    RECORD_SOURCE_TYPE_ANALOGUE_SERVICE
    Record source type for "Analogue Service".
    private static final int
    RECORD_SOURCE_TYPE_EXTERNAL_PLUG
    Record source type for "Exteranl Plug".
    private static final int
    RECORD_SOURCE_TYPE_EXTERNAL_PHYSICAL_ADDRESS
    Record source type for "External Physical Address".
    public static final int
    DIGITAL_BROADCAST_TYPE_ARIB
    public static final int
    DIGITAL_BROADCAST_TYPE_ATSC
    public static final int
    DIGITAL_BROADCAST_TYPE_DVB
    public static final int
    DIGITAL_BROADCAST_TYPE_ARIB_BS
    public static final int
    DIGITAL_BROADCAST_TYPE_ARIB_CS
    public static final int
    DIGITAL_BROADCAST_TYPE_ARIB_T
    public static final int
    DIGITAL_BROADCAST_TYPE_ATSC_CABLE
    public static final int
    DIGITAL_BROADCAST_TYPE_ATSC_SATELLITE
    public static final int
    DIGITAL_BROADCAST_TYPE_ATSC_TERRESTRIAL
    public static final int
    DIGITAL_BROADCAST_TYPE_DVB_C
    public static final int
    DIGITAL_BROADCAST_TYPE_DVB_S
    public static final int
    DIGITAL_BROADCAST_TYPE_DVB_S2
    public static final int
    DIGITAL_BROADCAST_TYPE_DVB_T
    private static final int
    CHANNEL_NUMBER_FORMAT_1_PART
    Channel number formats.
    private static final int
    CHANNEL_NUMBER_FORMAT_2_PART
    public static final int
    ANALOGUE_BROADCAST_TYPE_CABLE
    public static final int
    ANALOGUE_BROADCAST_TYPE_SATELLITE
    public static final int
    ANALOGUE_BROADCAST_TYPE_TERRESTRIAL
    public static final int
    BROADCAST_SYSTEM_PAL_BG
    public static final int
    BROADCAST_SYSTEM_SECAM_LP
    public static final int
    BROADCAST_SYSTEM_PAL_M
    public static final int
    BROADCAST_SYSTEM_NTSC_M
    public static final int
    BROADCAST_SYSTEM_PAL_I
    public static final int
    BROADCAST_SYSTEM_SECAM_DK
    public static final int
    BROADCAST_SYSTEM_SECAM_BG
    public static final int
    BROADCAST_SYSTEM_SECAM_L
    public static final int
    BROADCAST_SYSTEM_PAL_DK
    public static final int
    BROADCAST_SYSTEM_PAL_OTHER_SYSTEM
    Constructors Summary
    private HdmiRecordSources()

    
          
    Methods Summary
    public static booleancheckRecordSource(byte[] recordSource)
    Checks the byte array of record source.

    hide

            if (recordSource == null || recordSource.length == 0) return false;
    
            int recordSourceType = recordSource[0];
            int extraDataSize = recordSource.length - 1;
            switch (recordSourceType) {
                case RECORD_SOURCE_TYPE_OWN_SOURCE:
                    return extraDataSize == OwnSource.EXTRA_DATA_SIZE;
                case RECORD_SOURCE_TYPE_DIGITAL_SERVICE:
                    return extraDataSize == DigitalServiceSource.EXTRA_DATA_SIZE;
                case RECORD_SOURCE_TYPE_ANALOGUE_SERVICE:
                    return extraDataSize == AnalogueServiceSource.EXTRA_DATA_SIZE;
                case RECORD_SOURCE_TYPE_EXTERNAL_PLUG:
                    return extraDataSize == ExternalPlugData.EXTRA_DATA_SIZE;
                case RECORD_SOURCE_TYPE_EXTERNAL_PHYSICAL_ADDRESS:
                    return extraDataSize == ExternalPhysicalAddress.EXTRA_DATA_SIZE;
                default:
                    return false;
            }
        
    public static android.hardware.hdmi.HdmiRecordSources$AnalogueServiceSourceofAnalogue(int broadcastType, int frequency, int broadcastSystem)
    Creates {@link AnalogueServiceSource} of analogue service.

    param
    broadcastType
    param
    frequency
    param
    broadcastSystem
    hide

    
                          
        
              
                 
            if (broadcastType < ANALOGUE_BROADCAST_TYPE_CABLE
                    || broadcastType > ANALOGUE_BROADCAST_TYPE_TERRESTRIAL) {
                Log.w(TAG, "Invalid Broadcast type:" + broadcastType);
                throw new IllegalArgumentException("Invalid Broadcast type:" + broadcastType);
            }
            if (frequency < 0 || frequency > 0xFFFF) {
                Log.w(TAG, "Invalid frequency value[0x0000-0xFFFF]:" + frequency);
                throw new IllegalArgumentException(
                        "Invalid frequency value[0x0000-0xFFFF]:" + frequency);
            }
            if (broadcastSystem < BROADCAST_SYSTEM_PAL_BG
                    || broadcastSystem > BROADCAST_SYSTEM_PAL_OTHER_SYSTEM) {
    
                Log.w(TAG, "Invalid Broadcast system:" + broadcastSystem);
                throw new IllegalArgumentException(
                        "Invalid Broadcast system:" + broadcastSystem);
            }
    
            return new AnalogueServiceSource(broadcastType, frequency, broadcastSystem);
        
    public static android.hardware.hdmi.HdmiRecordSources$DigitalServiceSourceofArib(int aribType, android.hardware.hdmi.HdmiRecordSources$AribData data)
    Creates {@link DigitalServiceSource} of ARIB type.

    param
    aribType ARIB type. It should be one of
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_BS}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_CS}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_T}
    hide

            if (data == null) {
                throw new IllegalArgumentException("data should not be null.");
            }
            switch (aribType) {
                case DIGITAL_BROADCAST_TYPE_ARIB:
                case DIGITAL_BROADCAST_TYPE_ARIB_BS:
                case DIGITAL_BROADCAST_TYPE_ARIB_CS:
                case DIGITAL_BROADCAST_TYPE_ARIB_T:
                    return new DigitalServiceSource(
                            DigitalServiceSource.DIGITAL_SERVICE_IDENTIFIED_BY_DIGITAL_ID,
                            aribType, data);
                default:
                    Log.w(TAG, "Invalid ARIB type:" + aribType);
                    throw new IllegalArgumentException("type should not be null.");
            }
        
    public static android.hardware.hdmi.HdmiRecordSources$DigitalServiceSourceofAtsc(int atscType, android.hardware.hdmi.HdmiRecordSources$AtscData data)
    Creates {@link DigitalServiceSource} of ATSC type.

    param
    atscType ATSC type. It should be one of
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_CABLE}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_SATELLITE}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_TERRESTRIAL}
    hide

            if (data == null) {
                throw new IllegalArgumentException("data should not be null.");
            }
            switch (atscType) {
                case DIGITAL_BROADCAST_TYPE_ATSC:
                case DIGITAL_BROADCAST_TYPE_ATSC_CABLE:
                case DIGITAL_BROADCAST_TYPE_ATSC_SATELLITE:
                case DIGITAL_BROADCAST_TYPE_ATSC_TERRESTRIAL:
                    return new DigitalServiceSource(
                            DigitalServiceSource.DIGITAL_SERVICE_IDENTIFIED_BY_DIGITAL_ID,
                            atscType, data);
                default:
                    Log.w(TAG, "Invalid ATSC type:" + atscType);
                    throw new IllegalArgumentException("Invalid ATSC type:" + atscType);
            }
        
    public static android.hardware.hdmi.HdmiRecordSources$DigitalServiceSourceofDigitalChannelId(int broadcastSystem, android.hardware.hdmi.HdmiRecordSources$DigitalChannelData data)
    Creates {@link DigitalServiceSource} with channel type.

    param
    broadcastSystem digital broadcast system. It should be one of
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_BS}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_CS}
    • {@link #DIGITAL_BROADCAST_TYPE_ARIB_T}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_CABLE}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_SATELLITE}
    • {@link #DIGITAL_BROADCAST_TYPE_ATSC_TERRESTRIAL}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_C}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_S}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_S2}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_T}
    hide

            if (data == null) {
                throw new IllegalArgumentException("data should not be null.");
            }
            switch (broadcastSystem) {
                case DIGITAL_BROADCAST_TYPE_ARIB:
                case DIGITAL_BROADCAST_TYPE_ATSC:
                case DIGITAL_BROADCAST_TYPE_DVB:
                case DIGITAL_BROADCAST_TYPE_ARIB_BS:
                case DIGITAL_BROADCAST_TYPE_ARIB_CS:
                case DIGITAL_BROADCAST_TYPE_ARIB_T:
                case DIGITAL_BROADCAST_TYPE_ATSC_CABLE:
                case DIGITAL_BROADCAST_TYPE_ATSC_SATELLITE:
                case DIGITAL_BROADCAST_TYPE_ATSC_TERRESTRIAL:
                case DIGITAL_BROADCAST_TYPE_DVB_C:
                case DIGITAL_BROADCAST_TYPE_DVB_S:
                case DIGITAL_BROADCAST_TYPE_DVB_S2:
                case DIGITAL_BROADCAST_TYPE_DVB_T:
                    return new DigitalServiceSource(
                            DigitalServiceSource.DIGITAL_SERVICE_IDENTIFIED_BY_CHANNEL,
                            broadcastSystem,
                            data);
                default:
                    Log.w(TAG, "Invalid broadcast type:" + broadcastSystem);
                    throw new IllegalArgumentException(
                            "Invalid broadcast system value:" + broadcastSystem);
            }
        
    public static android.hardware.hdmi.HdmiRecordSources$DigitalServiceSourceofDvb(int dvbType, android.hardware.hdmi.HdmiRecordSources$DvbData data)
    Creates {@link DigitalServiceSource} of ATSC type.

    param
    dvbType DVB type. It should be one of
    • {@link #DIGITAL_BROADCAST_TYPE_DVB}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_C}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_S}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_S2}
    • {@link #DIGITAL_BROADCAST_TYPE_DVB_T}
    hide

            if (data == null) {
                throw new IllegalArgumentException("data should not be null.");
            }
            switch (dvbType) {
                case DIGITAL_BROADCAST_TYPE_DVB:
                case DIGITAL_BROADCAST_TYPE_DVB_C:
                case DIGITAL_BROADCAST_TYPE_DVB_S:
                case DIGITAL_BROADCAST_TYPE_DVB_S2:
                case DIGITAL_BROADCAST_TYPE_DVB_T:
                    return new DigitalServiceSource(
                            DigitalServiceSource.DIGITAL_SERVICE_IDENTIFIED_BY_DIGITAL_ID,
                            dvbType, data);
                default:
                    Log.w(TAG, "Invalid DVB type:" + dvbType);
                    throw new IllegalArgumentException("Invalid DVB type:" + dvbType);
            }
        
    public static android.hardware.hdmi.HdmiRecordSources$ExternalPhysicalAddressofExternalPhysicalAddress(int physicalAddress)
    Creates {@link ExternalPhysicalAddress} of external physical address.

    param
    physicalAddress
    hide

            if ((physicalAddress & ~0xFFFF) != 0) {
                Log.w(TAG, "Invalid physical address:" + physicalAddress);
                throw new IllegalArgumentException("Invalid physical address:" + physicalAddress);
            }
    
            return new ExternalPhysicalAddress(physicalAddress);
        
    public static android.hardware.hdmi.HdmiRecordSources$ExternalPlugDataofExternalPlug(int plugNumber)
    Creates {@link ExternalPlugData} of external plug type.

    param
    plugNumber plug number. It should be in range of [1, 255]
    hide

            if (plugNumber < 1 || plugNumber > 255) {
                Log.w(TAG, "Invalid plug number[1-255]" + plugNumber);
                throw new IllegalArgumentException("Invalid plug number[1-255]" + plugNumber);
            }
            return new ExternalPlugData(plugNumber);
        
    public static android.hardware.hdmi.HdmiRecordSources$OwnSourceofOwnSource()
    Creates {@link OwnSource} of own source.

            return new OwnSource();
        
    private static intshortToByteArray(short value, byte[] byteArray, int index)

            byteArray[index] = (byte) ((value >>> 8) & 0xFF);
            byteArray[index + 1] = (byte) (value & 0xFF);
            return 2;
        
    private static intthreeFieldsToSixBytes(int first, int second, int third, byte[] data, int index)

            shortToByteArray((short) first, data, index);
            shortToByteArray((short) second, data, index + 2);
            shortToByteArray((short) third, data, index + 4);
            return 6;