public final class HdmiTvClient extends HdmiClient
Modifier and Type | Class and Description |
---|---|
static interface |
HdmiTvClient.HdmiMhlVendorCommandListener
Interface used to get incoming MHL vendor command.
|
static interface |
HdmiTvClient.InputChangeListener
Callback interface used to get the input change event.
|
static interface |
HdmiTvClient.SelectCallback
Callback interface used to get the result of
deviceSelect(int, android.hardware.hdmi.HdmiTvClient.SelectCallback) . |
Modifier and Type | Field and Description |
---|---|
static int |
VENDOR_DATA_SIZE
Size of MHL register for vendor command
|
Modifier and Type | Method and Description |
---|---|
void |
clearTimerRecording(int recorderAddress,
int sourceType,
HdmiTimerRecordSources.TimerRecordSource source)
Clears timer recording with the given recorder address and recording source.
|
void |
deviceSelect(int logicalAddress,
HdmiTvClient.SelectCallback callback)
Selects a CEC logical device to be a new active source.
|
List<HdmiDeviceInfo> |
getDeviceList()
Returns all the CEC devices connected to TV.
|
int |
getDeviceType() |
void |
portSelect(int portId,
HdmiTvClient.SelectCallback callback)
Selects a HDMI port to be a new route path.
|
void |
sendMhlVendorCommand(int portId,
int offset,
int length,
byte[] data)
Sends MHL vendor command to the device connected to a port of the given portId.
|
void |
sendStandby(int deviceId)
Sends a <Standby> command to other device.
|
void |
setHdmiMhlVendorCommandListener(HdmiTvClient.HdmiMhlVendorCommandListener listener)
Sets
HdmiTvClient.HdmiMhlVendorCommandListener to get incoming MHL vendor command. |
void |
setInputChangeListener(HdmiTvClient.InputChangeListener listener)
Sets the listener used to get informed of the input change event.
|
void |
setRecordListener(HdmiRecordListener listener)
Sets record listener.
|
void |
setSystemAudioMode(boolean enabled,
HdmiTvClient.SelectCallback callback)
Sets system audio mode.
|
void |
setSystemAudioMute(boolean mute)
Sets system audio mute status.
|
void |
setSystemAudioVolume(int oldIndex,
int newIndex,
int maxIndex)
Sets system audio volume.
|
void |
startOneTouchRecord(int recorderAddress,
HdmiRecordSources.RecordSource source)
Starts one touch recording with the given recorder address and recorder source.
|
void |
startTimerRecording(int recorderAddress,
int sourceType,
HdmiTimerRecordSources.TimerRecordSource source)
Starts timer recording with the given recoder address and recorder source.
|
void |
stopOneTouchRecord(int recorderAddress)
Stops one touch record.
|
getActiveSource, sendKeyEvent, sendVendorCommand, setVendorCommandListener
public static final int VENDOR_DATA_SIZE
public int getDeviceType()
public void deviceSelect(int logicalAddress, HdmiTvClient.SelectCallback callback)
logicalAddress
- logical address of the device to selectcallback
- callback to get the result with{@link
- IllegalArgumentException} if the callback
is nullpublic void portSelect(int portId, HdmiTvClient.SelectCallback callback)
portId
- HDMI port to selectcallback
- callback to get the result with{@link
- IllegalArgumentException} if the callback
is nullpublic void setInputChangeListener(HdmiTvClient.InputChangeListener listener)
listener
- listener objectpublic List<HdmiDeviceInfo> getDeviceList()
HdmiDeviceInfo
for connected CEC devices.
Empty list is returned if there is none.public void setSystemAudioMode(boolean enabled, HdmiTvClient.SelectCallback callback)
enabled
- set to true
to enable the mode; otherwise false
callback
- callback to get the result with{@link
- IllegalArgumentException} if the callback
is nullpublic void setSystemAudioVolume(int oldIndex, int newIndex, int maxIndex)
oldIndex
- current volume indexnewIndex
- volume index to be setmaxIndex
- maximum volume indexpublic void setSystemAudioMute(boolean mute)
mute
- true
if muted; otherwise, false
public void setRecordListener(HdmiRecordListener listener)
listener
- public void sendStandby(int deviceId)
deviceId
- device id to send the command topublic void startOneTouchRecord(int recorderAddress, HdmiRecordSources.RecordSource source)
Usage
HdmiTvClient tvClient = ....; // for own source. OwnSource ownSource = HdmiRecordSources.ofOwnSource(); tvClient.startOneTouchRecord(recorderAddress, ownSource);
public void stopOneTouchRecord(int recorderAddress)
recorderAddress
- recorder address where recoding will be stoppedpublic void startTimerRecording(int recorderAddress, int sourceType, HdmiTimerRecordSources.TimerRecordSource source)
Usage
HdmiTvClient tvClient = ....; // create timer info TimerInfo timerInfo = HdmiTimerRecourdSources.timerInfoOf(...); // for digital source. DigitalServiceSource recordSource = HdmiRecordSources.ofDigitalService(...); // create timer recording source. TimerRecordSource source = HdmiTimerRecourdSources.ofDigitalSource(timerInfo, recordSource); tvClient.startTimerRecording(recorderAddress, source);
recorderAddress
- target recorder addresssourceType
- type of record source. It should be one of
HdmiControlManager.TIMER_RECORDING_TYPE_DIGITAL
,
HdmiControlManager.TIMER_RECORDING_TYPE_ANALOGUE
,
HdmiControlManager.TIMER_RECORDING_TYPE_EXTERNAL
.source
- record source to be usedpublic void clearTimerRecording(int recorderAddress, int sourceType, HdmiTimerRecordSources.TimerRecordSource source)
#startTimerRecording(int, int, TimerRecordSource)
.public void setHdmiMhlVendorCommandListener(HdmiTvClient.HdmiMhlVendorCommandListener listener)
HdmiTvClient.HdmiMhlVendorCommandListener
to get incoming MHL vendor command.listener
- to receive incoming MHL vendor commandpublic void sendMhlVendorCommand(int portId, int offset, int length, byte[] data)
portId
- id of port to send MHL vendor commandoffset
- offset in the in given datalength
- length of data. offset + length should be bound to length of data.data
- container for vendor command data. It should be 16 bytes.IllegalArgumentException
- if the given parameters are invalid