diff options
-rw-r--r-- | dxr3.c | 3 | ||||
-rw-r--r-- | dxr3.h | 3 | ||||
-rw-r--r-- | dxr3audiodecoder.c | 37 | ||||
-rw-r--r-- | dxr3audiodecoder.h | 6 | ||||
-rw-r--r-- | dxr3blackframe.c | 3 | ||||
-rw-r--r-- | dxr3colormanager.c | 3 | ||||
-rw-r--r-- | dxr3colormanager.h | 3 | ||||
-rw-r--r-- | dxr3configdata.c | 3 | ||||
-rw-r--r-- | dxr3configdata.h | 3 | ||||
-rw-r--r-- | dxr3demuxdevice.c | 3 | ||||
-rw-r--r-- | dxr3demuxdevice.h | 3 | ||||
-rw-r--r-- | dxr3device.c | 3 | ||||
-rw-r--r-- | dxr3device.h | 3 | ||||
-rw-r--r-- | dxr3generaldefines.h | 3 | ||||
-rw-r--r-- | dxr3interface.c | 3 | ||||
-rw-r--r-- | dxr3interface.h | 3 | ||||
-rw-r--r-- | dxr3interface_spu_encoder.c | 3 | ||||
-rw-r--r-- | dxr3interface_spu_encoder.h | 3 | ||||
-rw-r--r-- | dxr3multichannelaudio.c | 3 | ||||
-rw-r--r-- | dxr3multichannelaudio.h | 9 | ||||
-rw-r--r-- | dxr3osd.c | 3 | ||||
-rw-r--r-- | dxr3osd.h | 3 | ||||
-rw-r--r-- | dxr3output-audio.c | 9 | ||||
-rw-r--r-- | dxr3output-video.c | 3 | ||||
-rw-r--r-- | dxr3output.c | 3 | ||||
-rw-r--r-- | dxr3output.h | 3 | ||||
-rw-r--r-- | dxr3pesframe.c | 3 | ||||
-rw-r--r-- | dxr3pesframe.h | 26 | ||||
-rw-r--r-- | dxr3singleton.h | 3 | ||||
-rw-r--r-- | dxr3spudecoder.c | 3 | ||||
-rw-r--r-- | dxr3spudecoder.h | 3 | ||||
-rw-r--r-- | dxr3syncbuffer.c | 3 | ||||
-rw-r--r-- | dxr3syncbuffer.h | 3 | ||||
-rw-r--r-- | dxr3sysclock.c | 17 | ||||
-rw-r--r-- | dxr3sysclock.h | 3 | ||||
-rw-r--r-- | dxr3tools.h | 3 |
36 files changed, 126 insertions, 68 deletions
@@ -301,5 +301,6 @@ VDRPLUGINCREATOR(cPluginDxr3); // Don't touch this! // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: @@ -84,5 +84,6 @@ public: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3audiodecoder.c b/dxr3audiodecoder.c index 11bd066..9a04b1d 100644 --- a/dxr3audiodecoder.c +++ b/dxr3audiodecoder.c @@ -246,6 +246,40 @@ void cDxr3AudioDecoder::DecodeAc3Dts(const uint8_t* pPes, const uint8_t* buf, } } +/** + * \brief decoded payload of frame + */ +void cDxr3AudioDecoder::decode(cDxr3PesFrame *frame) +{ + int len; + int out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; + + const uint8_t *buf = frame->GetPayload(); + int length = frame->GetPayloadLength(); + +#if LIBAVCODEC_VERSION_INT < ((51<<16)+(29<<8)+0) + len = avcodec_decode_audio( +#else + len = avcodec_decode_audio2( +#endif + contextAudio, frame->decoded, &out_size, const_cast<uint8_t *>(buf), length); + + if (len < 0) { + esyslog("[dxr3-decoder] failed to decode audio"); + frame->decodedSize = 0; + return; + } + + // can this happen? + if ((length - len) > 0) { + esyslog("[dxr3-decoder] TODO: more to decode"); + } + + frame->decodedSize = len; + frame->ctx.channels = contextAudio->channels; + frame->ctx.samplerate = contextAudio->sample_rate; +} + // ================================== //! checking routine bool cDxr3AudioDecoder::HeadCheck(unsigned long head) @@ -272,5 +306,6 @@ bool cDxr3AudioDecoder::HeadCheck(unsigned long head) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3audiodecoder.h b/dxr3audiodecoder.h index 4ef0706..71f94fd 100644 --- a/dxr3audiodecoder.h +++ b/dxr3audiodecoder.h @@ -47,6 +47,9 @@ public: void DecodeAc3Dts(const uint8_t* pPes, const uint8_t* buf, int length, uint32_t pts, cDxr3SyncBuffer &aBuf); + + void decode(cDxr3PesFrame *frame); + void Reset() { ac3dtsDecoder.Clear(); @@ -76,5 +79,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3blackframe.c b/dxr3blackframe.c index ceccb08..7566dea 100644 --- a/dxr3blackframe.c +++ b/dxr3blackframe.c @@ -1290,5 +1290,6 @@ int blackframeLength = sizeof(blackframe); // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3colormanager.c b/dxr3colormanager.c index 5d994ac..42d9945 100644 --- a/dxr3colormanager.c +++ b/dxr3colormanager.c @@ -379,5 +379,6 @@ bool xSection::HasColor(unsigned int color, unsigned char &ColorIndex) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3colormanager.h b/dxr3colormanager.h index 65a62ac..6ea81ae 100644 --- a/dxr3colormanager.h +++ b/dxr3colormanager.h @@ -120,5 +120,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3configdata.c b/dxr3configdata.c index f3b682d..89c2d1b 100644 --- a/dxr3configdata.c +++ b/dxr3configdata.c @@ -42,5 +42,6 @@ cDxr3ConfigData::cDxr3ConfigData() // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3configdata.h b/dxr3configdata.h index e397fad..af1c54d 100644 --- a/dxr3configdata.h +++ b/dxr3configdata.h @@ -91,5 +91,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3demuxdevice.c b/dxr3demuxdevice.c index 3ed890c..b0fd4e3 100644 --- a/dxr3demuxdevice.c +++ b/dxr3demuxdevice.c @@ -520,5 +520,6 @@ int cDxr3DemuxDevice::DemuxAudioPes(const uint8_t* buf, int length) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3demuxdevice.h b/dxr3demuxdevice.h index b6f6355..492a782 100644 --- a/dxr3demuxdevice.h +++ b/dxr3demuxdevice.h @@ -79,5 +79,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3device.c b/dxr3device.c index b1c45b5..241f92e 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -239,5 +239,6 @@ cSpuDecoder *cDxr3Device::GetSpuDecoder() // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3device.h b/dxr3device.h index 5f085e7..d9bca5e 100644 --- a/dxr3device.h +++ b/dxr3device.h @@ -89,5 +89,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3generaldefines.h b/dxr3generaldefines.h index 28cfa9f..1ba1333 100644 --- a/dxr3generaldefines.h +++ b/dxr3generaldefines.h @@ -50,5 +50,6 @@ enum eDxr3TrickState { // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3interface.c b/dxr3interface.c index 0338b17..ffbd89c 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -813,5 +813,6 @@ cMutex* cDxr3Interface::m_pMutex = new cMutex; // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3interface.h b/dxr3interface.h index 06b2f5e..66a380f 100644 --- a/dxr3interface.h +++ b/dxr3interface.h @@ -195,5 +195,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3interface_spu_encoder.c b/dxr3interface_spu_encoder.c index d80a02d..fdc4bf3 100644 --- a/dxr3interface_spu_encoder.c +++ b/dxr3interface_spu_encoder.c @@ -644,5 +644,6 @@ void cSPUEncoder::CalculateActiveOsdArea() // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3interface_spu_encoder.h b/dxr3interface_spu_encoder.h index d226d14..177a75e 100644 --- a/dxr3interface_spu_encoder.h +++ b/dxr3interface_spu_encoder.h @@ -121,5 +121,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3multichannelaudio.c b/dxr3multichannelaudio.c index d8cbf69..b12332f 100644 --- a/dxr3multichannelaudio.c +++ b/dxr3multichannelaudio.c @@ -783,5 +783,6 @@ void cMultichannelAudio::Encapsulate(uchar *b, int length) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3multichannelaudio.h b/dxr3multichannelaudio.h index c9ac9c7..9e80a19 100644 --- a/dxr3multichannelaudio.h +++ b/dxr3multichannelaudio.h @@ -8,9 +8,9 @@ class cAudioEncapsulator; class cRingBufferFrame; // ================================== -// Based on AC3overDVB Patch maintained -// by Stefan Huelswitt -class cMultichannelAudio : public cMutex +// Based on AC3overDVB Patch maintained +// by Stefan Huelswitt +class cMultichannelAudio : public cMutex { private: cAudioEncapsulator *encapsulator; @@ -40,5 +40,6 @@ public: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: @@ -310,5 +310,6 @@ void cDxr3Osd::Flush() // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: @@ -39,5 +39,6 @@ public: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3output-audio.c b/dxr3output-audio.c index dd1e4ba..f540687 100644 --- a/dxr3output-audio.c +++ b/dxr3output-audio.c @@ -128,14 +128,14 @@ void cDxr3AudioOutThread::PlayFrame(cFixedLengthFrame *frame) void cDxr3AudioOutThread::PlayFrame(cDxr3PesFrame *frame) { // update audio context - audioOutput->setup(frame->GetSampleContext()); + audioOutput->setup(frame->ctx); // volume changes if (!cDxr3Interface::instance()->IsAudioModeAC3()) { - audioOutput->changeVolume((short *)frame->GetDecoded(), (size_t)frame->GetDecodedSize()); + audioOutput->changeVolume((short *)frame->decoded, (size_t)frame->decodedSize); } - audioOutput->write((uchar *)frame->GetDecoded(), frame->GetDecodedSize()); + audioOutput->write((uchar *)frame->decoded, frame->decodedSize); } #undef SCR @@ -144,5 +144,6 @@ void cDxr3AudioOutThread::PlayFrame(cDxr3PesFrame *frame) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3output-video.c b/dxr3output-video.c index 7493f95..07b9790 100644 --- a/dxr3output-video.c +++ b/dxr3output-video.c @@ -99,5 +99,6 @@ void cDxr3VideoOutThread::Action() // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3output.c b/dxr3output.c index 6e83368..32fc178 100644 --- a/dxr3output.c +++ b/dxr3output.c @@ -36,5 +36,6 @@ cDxr3OutputThread::cDxr3OutputThread(cDxr3SyncBuffer& buffer) : // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3output.h b/dxr3output.h index 083893e..e6ba792 100644 --- a/dxr3output.h +++ b/dxr3output.h @@ -80,5 +80,6 @@ protected: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3pesframe.c b/dxr3pesframe.c index 1ab30df..639d43d 100644 --- a/dxr3pesframe.c +++ b/dxr3pesframe.c @@ -121,5 +121,6 @@ uint32_t cDxr3PesFrame::m_staticAspectRatio = EM8300_ASPECTRATIO_4_3; // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3pesframe.h b/dxr3pesframe.h index b9aa664..5c561a3 100644 --- a/dxr3pesframe.h +++ b/dxr3pesframe.h @@ -114,20 +114,10 @@ public: return m_verticalSize; } - SampleContext GetSampleContext() const - { - return ctx; - } - - uint32_t GetDecodedSize() const - { - return decodedSize; - } - - const int16_t *GetDecoded() - { - return decoded; - } + // needed for audio + uint32_t decodedSize; + int16_t *decoded; + SampleContext ctx; private: ePesDataType m_pesDataType; @@ -143,11 +133,6 @@ private: static uint32_t m_staticAspectRatio; - // needed for audio - uint32_t decodedSize; - const int16_t *decoded; - SampleContext ctx; - static const uint32_t MAX_PES_HEADER_SIZE; }; @@ -157,5 +142,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3singleton.h b/dxr3singleton.h index b53ac79..56663f1 100644 --- a/dxr3singleton.h +++ b/dxr3singleton.h @@ -66,5 +66,6 @@ cMutex Singleton<T>::m; // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3spudecoder.c b/dxr3spudecoder.c index a197800..132658c 100644 --- a/dxr3spudecoder.c +++ b/dxr3spudecoder.c @@ -628,5 +628,6 @@ int cDxr3SpuDecoder::setTime(uint32_t pts) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3spudecoder.h b/dxr3spudecoder.h index 70adf57..0191527 100644 --- a/dxr3spudecoder.h +++ b/dxr3spudecoder.h @@ -182,5 +182,6 @@ inline uint32_t cDxr3SpuPalette::getColor(uint8_t idx, uint8_t trans) const // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3syncbuffer.c b/dxr3syncbuffer.c index ffdb0d2..de0c202 100644 --- a/dxr3syncbuffer.c +++ b/dxr3syncbuffer.c @@ -331,5 +331,6 @@ void cDxr3SyncBuffer::ReceiverStopped(void) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3syncbuffer.h b/dxr3syncbuffer.h index 2c95a5c..a34a9b1 100644 --- a/dxr3syncbuffer.h +++ b/dxr3syncbuffer.h @@ -146,5 +146,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3sysclock.c b/dxr3sysclock.c index b9db9b1..1e581e3 100644 --- a/dxr3sysclock.c +++ b/dxr3sysclock.c @@ -23,10 +23,10 @@ #include "dxr3sysclock.h" // ================================== -void cDxr3SysClock::SetSysClock(uint32_t scr) +void cDxr3SysClock::SetSysClock(uint32_t scr) { uint32_t sc; - + mutex.Lock(); ioctl(m_fdcontrol, EM8300_IOCTL_SCR_GET, &sc); m_offset = scr - sc; @@ -34,11 +34,11 @@ void cDxr3SysClock::SetSysClock(uint32_t scr) } // ================================== -uint32_t cDxr3SysClock::GetSysClock(void) +uint32_t cDxr3SysClock::GetSysClock(void) { uint32_t sc; uint32_t retval; - + mutex.Lock(); ioctl(m_fdcontrol, EM8300_IOCTL_SCR_GET, &sc); retval = sc + m_offset; @@ -48,10 +48,10 @@ uint32_t cDxr3SysClock::GetSysClock(void) } // ================================== -void cDxr3SysClock::SetPts(uint32_t pts) +void cDxr3SysClock::SetPts(uint32_t pts) { uint32_t newPts = 0; - + mutex.Lock(); newPts = pts - m_offset; ioctl(m_fdvideo, EM8300_IOCTL_VIDEO_SETPTS, &newPts); @@ -59,7 +59,7 @@ void cDxr3SysClock::SetPts(uint32_t pts) } // ================================== -void cDxr3SysClock::SetSpuPts(uint32_t pts) +void cDxr3SysClock::SetSpuPts(uint32_t pts) { uint32_t newPts = 0; @@ -73,5 +73,6 @@ void cDxr3SysClock::SetSpuPts(uint32_t pts) // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3sysclock.h b/dxr3sysclock.h index f9fc3e5..12d4946 100644 --- a/dxr3sysclock.h +++ b/dxr3sysclock.h @@ -58,5 +58,6 @@ private: // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: diff --git a/dxr3tools.h b/dxr3tools.h index a4818d5..588217d 100644 --- a/dxr3tools.h +++ b/dxr3tools.h @@ -106,5 +106,6 @@ namespace Tools // mode: c++ // c-file-style: "stroustrup" // c-file-offsets: ((inline-open . 0)) -// indent-tabs-mode: t +// tab-width: 4; +// indent-tabs-mode: nil // End: |