vuduo4k/vuduo4kse/vuultimo4k/vuuno4kse: HDMI input as mode and PiP added

Origin commit data
------------------
Branch: master
Commit: d3d0b40f89
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2021-05-09 (Sun, 09 May 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
BPanther
2021-05-09 21:25:43 +02:00
committed by vanhofen
parent 697953230a
commit bf8a99aa68
10 changed files with 175 additions and 6 deletions

View File

@@ -18,13 +18,31 @@
#define hal_debug(args...) _hal_debug(HAL_DEBUG_AUDIO, this, args)
#define hal_info(args...) _hal_info(HAL_DEBUG_AUDIO, this, args)
#define fop(cmd, args...) ({ \
int _r; \
if (fd >= 0) { \
if ((_r = ::cmd(fd, args)) < 0) \
hal_info(#cmd"(fd, "#args")\n");\
else \
hal_debug(#cmd"(fd, "#args")\n");\
} \
else { _r = fd; } \
_r; \
})
#include <linux/soundcard.h>
enum
{ ENCODER,
AUX
};
cAudio * audioDecoder = NULL;
cAudio::cAudio(void *, void *, void *)
{
fd = -1;
fdd = false;
clipfd = -1;
mixer_fd = -1;
openDevice();
@@ -65,6 +83,48 @@ void cAudio::closeDevice(void)
}
}
#ifndef AUDIO_SOURCE_HDMI
#define AUDIO_SOURCE_HDMI 2
#endif
void cAudio::open_AVInput_Device(void)
{
hal_debug("%s\n", __func__);
if (fdd) /* already open */
return;
fop(ioctl, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_HDMI);
fop(ioctl, AUDIO_PLAY);
fdd = true;
}
void cAudio::close_AVInput_Device(void)
{
hal_debug("%s\n", __func__);
if (fdd) {
fop(ioctl, AUDIO_STOP);
}
fdd = false;
}
void cAudio::setAVInput(int val)
{
hal_info("%s - switching to: %s\n", __func__, val == AUX ? "AUX" : "ENCODER");
if (val == AUX) {
Stop();
open_AVInput_Device();
} else {
if (fdd) {
close_AVInput_Device();
fop(ioctl, AUDIO_SELECT_SOURCE, AUDIO_SOURCE_DEMUX);
Start();
}
}
}
int cAudio::do_mute(bool enable, bool remember)
{
hal_debug("%s(%d, %d)\n", __FUNCTION__, enable, remember);