1
0
mirror of https://github.com/rofafor/vdr-plugin-femon.git synced 2023-10-10 13:36:53 +02:00

Modified cFemonReceiver constructor.

This commit is contained in:
Rolf Ahrenberg 2012-03-31 11:47:57 +03:00
parent f1d9b112a4
commit 0f8cc6c9ce
3 changed files with 15 additions and 13 deletions

View File

@ -672,7 +672,7 @@ void cFemonOsd::Show(void)
{ {
debug("%s()\n", __PRETTY_FUNCTION__); debug("%s()\n", __PRETTY_FUNCTION__);
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
m_DeviceSource = DEVICESOURCE_DVBAPI; m_DeviceSource = DEVICESOURCE_DVBAPI;
if (channel) { if (channel) {
@ -727,7 +727,7 @@ void cFemonOsd::Show(void)
DELETENULL(m_Receiver); DELETENULL(m_Receiver);
} }
if (femonConfig.analyzestream && channel) { if (femonConfig.analyzestream && channel) {
m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver); cDevice::ActualDevice()->AttachReceiver(m_Receiver);
} }
Start(); Start();
@ -738,7 +738,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
{ {
debug("%s(%d,%d)\n", __PRETTY_FUNCTION__, device->DeviceNumber(), channelNumber); debug("%s(%d,%d)\n", __PRETTY_FUNCTION__, device->DeviceNumber(), channelNumber);
eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack(); eTrackType track = cDevice::PrimaryDevice()->GetCurrentAudioTrack();
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber) if (!liveView || !channelNumber || !channel || channel->Number() != channelNumber)
return; return;
@ -784,7 +784,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber, bool li
DELETENULL(m_Receiver); DELETENULL(m_Receiver);
} }
if (femonConfig.analyzestream && channel) { if (femonConfig.analyzestream && channel) {
m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver); cDevice::ActualDevice()->AttachReceiver(m_Receiver);
} }
} }
@ -798,9 +798,9 @@ void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks)
DELETENULL(m_Receiver); DELETENULL(m_Receiver);
} }
if (femonConfig.analyzestream) { if (femonConfig.analyzestream) {
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel()); const cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (channel) { if (channel) {
m_Receiver = new cFemonReceiver(channel->Vtype(), channel->Vpid(), channel->Apid(IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0), channel->Dpid(IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0)); m_Receiver = new cFemonReceiver(channel, IS_AUDIO_TRACK(track) ? int(track - ttAudioFirst) : 0, IS_DOLBY_TRACK(track) ? int(track - ttDolbyFirst) : 0);
cDevice::ActualDevice()->AttachReceiver(m_Receiver); cDevice::ActualDevice()->AttachReceiver(m_Receiver);
} }
} }

View File

@ -10,8 +10,9 @@
#include "femoncfg.h" #include "femoncfg.h"
#include "femonreceiver.h" #include "femonreceiver.h"
cFemonReceiver::cFemonReceiver(int Vtype, int Vpid, int Apid, int Dpid) cFemonReceiver::cFemonReceiver(const cChannel *Channel, int ATrack, int DTrack)
: cThread("femon receiver"), : cReceiver(Channel),
cThread("femon receiver"),
m_Mutex(), m_Mutex(),
m_Sleep(), m_Sleep(),
m_Active(false), m_Active(false),
@ -21,24 +22,25 @@ cFemonReceiver::cFemonReceiver(int Vtype, int Vpid, int Apid, int Dpid)
m_DetectLATM(this), m_DetectLATM(this),
m_DetectAC3(this), m_DetectAC3(this),
m_VideoBuffer(KILOBYTE(512), TS_SIZE, false, "Femon video"), m_VideoBuffer(KILOBYTE(512), TS_SIZE, false, "Femon video"),
m_VideoType(Vtype), m_VideoType(Channel ? Channel->Vtype(): 0),
m_VideoPid(Vpid), m_VideoPid(Channel ? Channel->Vpid() : 0),
m_VideoPacketCount(0), m_VideoPacketCount(0),
m_VideoBitrate(0.0), m_VideoBitrate(0.0),
m_VideoValid(false), m_VideoValid(false),
m_AudioBuffer(KILOBYTE(256), TS_SIZE, false, "Femon audio"), m_AudioBuffer(KILOBYTE(256), TS_SIZE, false, "Femon audio"),
m_AudioPid(Apid), m_AudioPid(Channel ? Channel->Apid(ATrack) : 0),
m_AudioPacketCount(0), m_AudioPacketCount(0),
m_AudioBitrate(0.0), m_AudioBitrate(0.0),
m_AudioValid(false), m_AudioValid(false),
m_AC3Buffer(KILOBYTE(256), TS_SIZE, false, "Femon AC3"), m_AC3Buffer(KILOBYTE(256), TS_SIZE, false, "Femon AC3"),
m_AC3Pid(Dpid), m_AC3Pid(Channel ? Channel->Dpid(DTrack) : 0),
m_AC3PacketCount(0), m_AC3PacketCount(0),
m_AC3Bitrate(0), m_AC3Bitrate(0),
m_AC3Valid(false) m_AC3Valid(false)
{ {
debug("%s()\n", __PRETTY_FUNCTION__); debug("%s()\n", __PRETTY_FUNCTION__);
SetPids(NULL);
AddPid(m_VideoPid); AddPid(m_VideoPid);
AddPid(m_AudioPid); AddPid(m_AudioPid);
AddPid(m_AC3Pid); AddPid(m_AC3Pid);

View File

@ -108,7 +108,7 @@ public:
m_AC3Info.lfe = onoff; } m_AC3Info.lfe = onoff; }
public: public:
cFemonReceiver(int Vtype, int Vpid, int Apid, int Dpid); cFemonReceiver(const cChannel* Channel, int ATrack, int DTrack);
virtual ~cFemonReceiver(); virtual ~cFemonReceiver();
void Deactivate(void); void Deactivate(void);