2004-03-03 03:20:00 +01:00
|
|
|
/*
|
|
|
|
* Frontend Status Monitor plugin for the Video Disk Recorder
|
|
|
|
*
|
|
|
|
* See the README file for copyright information and how to reach the author.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-02-26 03:20:00 +01:00
|
|
|
#ifndef __FEMONRECEIVER_H
|
|
|
|
#define __FEMONRECEIVER_H
|
|
|
|
|
2004-03-03 03:20:00 +01:00
|
|
|
#include <vdr/thread.h>
|
2004-02-26 03:20:00 +01:00
|
|
|
#include <vdr/receiver.h>
|
|
|
|
|
2009-08-25 19:22:06 +02:00
|
|
|
#include "femonh264.h"
|
|
|
|
#include "femonmpeg.h"
|
|
|
|
#include "femonaac.h"
|
2010-06-23 11:16:17 +02:00
|
|
|
#include "femonlatm.h"
|
2009-08-25 19:22:06 +02:00
|
|
|
#include "femonac3.h"
|
2008-11-09 12:43:27 +01:00
|
|
|
#include "femonaudio.h"
|
|
|
|
#include "femonvideo.h"
|
2009-08-25 19:22:06 +02:00
|
|
|
#include "femontools.h"
|
2004-06-06 03:20:00 +02:00
|
|
|
|
2009-08-25 19:22:06 +02:00
|
|
|
class cFemonReceiver : public cReceiver, public cThread, public cFemonVideoIf, public cFemonAudioIf, public cFemonAC3If {
|
2004-02-26 03:20:00 +01:00
|
|
|
private:
|
2009-09-27 15:59:42 +02:00
|
|
|
cMutex m_Mutex;
|
|
|
|
cCondWait m_Sleep;
|
|
|
|
bool m_Active;
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2009-09-27 15:59:42 +02:00
|
|
|
cFemonH264 m_DetectH264;
|
|
|
|
cFemonMPEG m_DetectMPEG;
|
|
|
|
cFemonAAC m_DetectAAC;
|
2010-06-23 11:16:17 +02:00
|
|
|
cFemonLATM m_DetectLATM;
|
2009-09-27 15:59:42 +02:00
|
|
|
cFemonAC3 m_DetectAC3;
|
2009-08-25 19:22:06 +02:00
|
|
|
|
2009-09-27 15:59:42 +02:00
|
|
|
cRingBufferLinear m_VideoBuffer;
|
|
|
|
cTsToPes m_VideoAssembler;
|
|
|
|
int m_VideoType;
|
|
|
|
int m_VideoPid;
|
|
|
|
int m_VideoPacketCount;
|
|
|
|
double m_VideoBitrate;
|
|
|
|
bool m_VideoValid;
|
|
|
|
video_info_t m_VideoInfo;
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2009-09-27 15:59:42 +02:00
|
|
|
cRingBufferLinear m_AudioBuffer;
|
|
|
|
cTsToPes m_AudioAssembler;
|
|
|
|
int m_AudioPid;
|
|
|
|
int m_AudioPacketCount;
|
|
|
|
double m_AudioBitrate;
|
|
|
|
bool m_AudioValid;
|
|
|
|
audio_info_t m_AudioInfo;
|
2008-11-09 12:43:27 +01:00
|
|
|
|
2009-09-27 15:59:42 +02:00
|
|
|
cRingBufferLinear m_AC3Buffer;
|
|
|
|
cTsToPes m_AC3Assembler;
|
|
|
|
int m_AC3Pid;
|
|
|
|
int m_AC3PacketCount;
|
|
|
|
double m_AC3Bitrate;
|
|
|
|
bool m_AC3Valid;
|
|
|
|
ac3_info_t m_AC3Info;
|
2004-02-26 03:20:00 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void Activate(bool On);
|
|
|
|
virtual void Receive(uchar *Data, int Length);
|
2004-03-03 03:20:00 +01:00
|
|
|
virtual void Action(void);
|
2004-02-26 03:20:00 +01:00
|
|
|
|
2009-08-25 19:22:06 +02:00
|
|
|
public:
|
2009-09-01 14:30:48 +02:00
|
|
|
virtual void SetVideoCodec(eVideoCodec codec) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.codec = codec; }
|
|
|
|
virtual void SetVideoFormat(eVideoFormat format) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.format = format; }
|
|
|
|
virtual void SetVideoScan(eVideoScan scan) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.scan = scan; }
|
|
|
|
virtual void SetVideoAspectRatio(eVideoAspectRatio aspectratio) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.aspectRatio = aspectratio; }
|
|
|
|
virtual void SetVideoSize(int width, int height) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.width = width;
|
|
|
|
m_VideoInfo.height = height; }
|
|
|
|
virtual void SetVideoFramerate(double framerate) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.frameRate = framerate; }
|
|
|
|
virtual void SetVideoBitrate(double bitrate) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_VideoInfo.bitrate = bitrate; }
|
|
|
|
|
|
|
|
virtual void SetAudioCodec(eAudioCodec codec) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AudioInfo.codec = codec; }
|
|
|
|
virtual void SetAudioBitrate(double bitrate) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AudioInfo.bitrate = bitrate; }
|
|
|
|
virtual void SetAudioSamplingFrequency(int sampling) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AudioInfo.samplingFrequency = sampling; }
|
|
|
|
virtual void SetAudioChannel(eAudioChannelMode mode) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AudioInfo.channelMode = mode; }
|
|
|
|
|
|
|
|
virtual void SetAC3Bitrate(int bitrate) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.bitrate = bitrate; }
|
|
|
|
virtual void SetAC3SamplingFrequency(int sampling) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.samplingFrequency = sampling; }
|
|
|
|
virtual void SetAC3Bitstream(int mode) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.bitstreamMode = mode; }
|
|
|
|
virtual void SetAC3AudioCoding(int mode) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.audioCodingMode = mode; }
|
|
|
|
virtual void SetAC3DolbySurround(int mode) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.dolbySurroundMode = mode; }
|
|
|
|
virtual void SetAC3CenterMix(int level) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.centerMixLevel = level; }
|
|
|
|
virtual void SetAC3SurroundMix(int level) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.surroundMixLevel = level; }
|
|
|
|
virtual void SetAC3Dialog(int level) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.dialogLevel = level; }
|
|
|
|
virtual void SetAC3LFE(bool onoff) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
m_AC3Info.lfe = onoff; }
|
2009-08-25 19:22:06 +02:00
|
|
|
|
2004-02-26 03:20:00 +01:00
|
|
|
public:
|
2012-03-31 10:47:57 +02:00
|
|
|
cFemonReceiver(const cChannel* Channel, int ATrack, int DTrack);
|
2004-02-26 03:20:00 +01:00
|
|
|
virtual ~cFemonReceiver();
|
2008-11-23 21:26:48 +01:00
|
|
|
void Deactivate(void);
|
2004-02-26 03:20:00 +01:00
|
|
|
|
2009-09-01 14:30:48 +02:00
|
|
|
bool VideoValid(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoValid; }; // boolean
|
|
|
|
double VideoBitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoBitrate; }; // bit/s
|
|
|
|
int VideoCodec(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.codec; }; // eVideoCodec
|
|
|
|
int VideoFormat(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.format; }; // eVideoFormat
|
|
|
|
int VideoScan(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.scan; }; // eVideoScan
|
|
|
|
int VideoAspectRatio(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.aspectRatio; }; // eVideoAspectRatio
|
|
|
|
int VideoHorizontalSize(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.width; }; // pixels
|
|
|
|
int VideoVerticalSize(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.height; }; // pixels
|
|
|
|
double VideoFrameRate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.frameRate; }; // Hz
|
|
|
|
double VideoStreamBitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_VideoInfo.bitrate; }; // bit/s
|
|
|
|
|
|
|
|
bool AudioValid(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioValid; }; // boolean
|
|
|
|
double AudioBitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioBitrate; }; // bit/s
|
|
|
|
int AudioCodec(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioInfo.codec; }; // eAudioCodec
|
|
|
|
int AudioChannelMode(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioInfo.channelMode; }; // eAudioChannelMode
|
|
|
|
double AudioStreamBitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioInfo.bitrate; }; // bit/s or eAudioBitrate
|
|
|
|
int AudioSamplingFreq(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AudioInfo.samplingFrequency; }; // Hz or eAudioSamplingFrequency
|
|
|
|
|
|
|
|
bool AC3Valid(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Valid; }; // boolean
|
|
|
|
double AC3Bitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Bitrate; }; // bit/s
|
|
|
|
double AC3StreamBitrate(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.bitrate; }; // bit/s or eAudioBitrate
|
|
|
|
int AC3SamplingFreq(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.samplingFrequency; }; // Hz or eAudioSamplingFrequency
|
|
|
|
int AC3BitStreamMode(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.bitstreamMode; }; // 0..7 or eAudioBitstreamMode
|
|
|
|
int AC3AudioCodingMode(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.audioCodingMode; }; // 0..7 or eAudioCodingMode
|
|
|
|
bool AC3_2_0(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return (m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_2_0); }; // boolean
|
|
|
|
bool AC3_5_1(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return (m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_3_2); }; // boolean
|
|
|
|
int AC3DolbySurroundMode(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.dolbySurroundMode; }; // eAudioDolbySurroundMode
|
|
|
|
int AC3CenterMixLevel(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.centerMixLevel; }; // eAudioCenterMixLevel
|
|
|
|
int AC3SurroundMixLevel(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.surroundMixLevel; }; // eAudioSurroundMixLevel
|
|
|
|
int AC3DialogLevel(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.dialogLevel; }; // -dB
|
|
|
|
bool AC3Lfe(void) { cMutexLock MutexLock(&m_Mutex);
|
|
|
|
return m_AC3Info.lfe; }; // boolean
|
2004-02-26 03:20:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //__FEMONRECEIVER_H
|
|
|
|
|