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

Compare commits

...

16 Commits

Author SHA1 Message Date
Rolf Ahrenberg
daf823435b Changed to use VDR's core translations. 2009-08-29 21:01:20 +03:00
Rolf Ahrenberg
53b42a2d4a Fixed H.264 parser. 2009-08-28 20:54:34 +03:00
Rolf Ahrenberg
167da08ab3 Silenced compiler warnings. 2009-08-26 22:44:49 +03:00
Rolf Ahrenberg
61ff96556e Fixed bitstream parser for H.264. 2009-08-26 16:24:49 +03:00
Rolf Ahrenberg
a06ae6f6ff Added PES assembler. 2009-08-25 20:22:06 +03:00
Rolf Ahrenberg
2e6a236a56 Removed OSD offset and height options. 2009-07-08 23:14:19 +03:00
Rolf Ahrenberg
6086c135c7 Added missing MINFONTSIZE and MAXFONTSIZE defines. 2009-06-18 23:08:25 +03:00
Rolf Ahrenberg
db9735b80b Cleaned up compilation warnings. 2009-06-18 17:38:27 +03:00
Rolf Ahrenberg
84878bd1b9 Cleaned up compilation warnings. 2009-06-18 17:35:35 +03:00
Rolf Ahrenberg
afd72642e9 Fixed font handling to be thread-safe. 2009-06-18 12:16:11 +03:00
Rolf Ahrenberg
0a162a9a8c Cleaned up compilation warnings. 2009-03-24 12:51:51 +02:00
Rolf Ahrenberg
2e2aacd573 Fixed end of sequence NAL unit. 2009-02-11 14:51:55 +02:00
Rolf Ahrenberg
4e8fdaf99f Fixed closing of frontend file handles. 2009-01-06 23:10:02 +02:00
Rolf Ahrenberg
eb2da4721c Added whitespace cleanups. 2008-12-16 12:51:59 +02:00
Rolf Ahrenberg
5cf9b4af0b Updated for vdr-1.7.2.
Removed the "Show CA system" setup option.
2008-12-16 12:26:46 +02:00
Rolf Ahrenberg
83556bf2d3 Added whitespace cleanups.
Changed info window to use the channel source instead of the frontend type.
2008-12-13 22:25:26 +02:00
29 changed files with 1320 additions and 1388 deletions

72
HISTORY
View File

@@ -29,7 +29,8 @@ VDR Plugin 'femon' Revision History
- Redesigned the user interface.
- Transponder information is now available in advanced display mode:
Press 'OK' key to switch between the simple and the advanced display mode.
Press 'OK' key to switch between the simple and the advanced display
mode.
- Moved bitrate calculation to it's own thread for improved accurancy.
2004-03-07: Version 0.0.3a
@@ -41,7 +42,8 @@ VDR Plugin 'femon' Revision History
2004-03-16: Version 0.0.3b
- Fixed channel toggling with '0' key.
- Bitrate calculation thread is now canceled immediately to speed up channel switching.
- Bitrate calculation thread is now canceled immediately to speed up
channel switching.
2004-04-04: Version 0.0.3c
@@ -88,7 +90,8 @@ VDR Plugin 'femon' Revision History
2004-06-11: Version 0.1.3
- Added "AC-3 Stream Information" display mode (Thanks to Lothar Englisch).
- Added "AC-3 Stream Information" display mode (Thanks to Lothar
Englisch).
2004-06-24: Version 0.1.4
@@ -100,7 +103,8 @@ VDR Plugin 'femon' Revision History
- Fixed OSDSTATUSWIN_XC define.
- Added preliminary NTSC support (make NTSC_SYSTEM=1 plugins).
- Fixed "Setup/OSD/Use Small Fonts" bug (Thanks to Winni for reporting this one).
- Fixed "Setup/OSD/Use Small Fonts" bug (Thanks to Winni for reporting
this one).
- Added patches directory: CA system names by Lauri Tischler.
2004-09-11: Version 0.1.6
@@ -146,7 +150,8 @@ VDR Plugin 'femon' Revision History
2005-04-01: Version 0.8.7
- Default make target is now all.
- Fixed the access rights of symbols subdirectory (Thanks to Harri Kukkonen).
- Fixed the access rights of symbols subdirectory (Thanks to Harri
Kukkonen).
- Added a new theme: Moronimo (Thanks to Morone).
2005-04-02: Version 0.8.8
@@ -160,7 +165,8 @@ VDR Plugin 'femon' Revision History
2005-05-20: Version 0.9.0
- Renamed compiling switches ('DEBUG' to 'FEMON_DEBUG' and 'NTSC_SYSTEM' to 'FEMON_NTSC').
- Renamed compiling switches ('DEBUG' to 'FEMON_DEBUG' and 'NTSC_SYSTEM'
to 'FEMON_NTSC').
- Enabled preliminary support for the device switching.
2005-07-23: Version 0.9.1
@@ -200,7 +206,8 @@ VDR Plugin 'femon' Revision History
- Updated for vdr-1.3.40.
- Fixed a translation bug (Thanks to Antti Hartikainen).
- Fixed AC3 header parsing bug (Thanks to Axel Katzur for reporting this one).
- Fixed AC3 header parsing bug (Thanks to Axel Katzur for reporting this
one).
- Fixed EgalsTry theme (Thanks to Uwe Hanke).
2006-02-06: Version 0.9.7
@@ -248,7 +255,8 @@ VDR Plugin 'femon' Revision History
2007-05-01: Version 1.1.2
- Fixed opening while replaying (Thanks to Antti Seppälä for reporting this one).
- Fixed opening while replaying (Thanks to Antti Seppälä for reporting
this one).
2007-05-15: Version 1.1.3
@@ -298,7 +306,7 @@ VDR Plugin 'femon' Revision History
2008-06-20: Version 1.6.1
- Updated Italian translation (Thanks to Diego Pierotto).
- Fixed a crash if no channel available (Thanks to Winfried Köhler)
- Fixed a crash if no channel available (Thanks to Winfried Köhler).
2008-10-12: Version 1.6.2
@@ -317,6 +325,48 @@ VDR Plugin 'femon' Revision History
- Updated Italian translation (Thanks to Diego Pierotto).
- Fixed a memory leak.
- Added a check for the minimum OSD height.
- Replaced "Use single area (8bpp)" option with VDR's "Setup/OSD/Anti-alias".
- Replaced "Use single area (8bpp)" option with VDR's
"Setup/OSD/Anti-alias".
- Removed the FEMON_NTSC option.
- Fixed a deadlock in cFemonReceiver (Thanks to Antti Seppälä for reporting this one).
- Fixed a deadlock in cFemonReceiver (Thanks to Antti Seppälä for
reporting this one).
2008-12-16: Version 1.6.5
- Backported from 1.7.0.
2009-01-06: Version 1.6.6
- Backported from 1.7.1.
2009-06-18: Version 1.6.7
- Backported from 1.7.2.
===================================
VDR Plugin 'femon' Revision History
===================================
2008-12-16: Version 1.7.0
- Updated for vdr-1.7.2.
- Added whitespace cleanups.
- Changed info window to use the channel source instead of the frontend
type.
- Removed the "Show CA system" setup option.
2009-01-06: Version 1.7.1
- Fixed closing of frontend file handles (Thanks to Brendon Higgins for
reporting this one).
2009-06-18: Version 1.7.2
- Cleaned up compilation warnings.
- Fixed font handling to be thread-safe.
2009-08-29: Version 1.7.3
- Removed OSD offset and height options.
- Added PES assembler.
- Added bitstream parsers for all codecs.

View File

@@ -23,7 +23,7 @@ VERSION = $(shell grep 'static const char VERSION\[\] *=' $(PLUGIN).c | awk '{ p
### The C++ compiler and options:
CXX ?= g++
CXXFLAGS ?= -fPIC -g -O2 -Wall -Woverloaded-virtual -Wno-parentheses
CXXFLAGS ?= -fPIC -g -O2 -Wall -Wextra -Wswitch-default -Wfloat-equal -Wundef -Wpointer-arith -Wconversion -Wcast-align -Wredundant-decls -Wno-unused-parameter -Woverloaded-virtual -Wno-parentheses
### The directory environment:

10
README
View File

@@ -26,10 +26,7 @@ transponder and stream information are also available in advanced display modes.
The plugin is based on a neat console frontend status monitor application
called 'femon' by Johannes Stezenbach (see DVB-apps/szap/femon.c for further
information). The bitrate calculation trick originates from the 'dvbstream'
application by Dave Chapman and the stream information routines are taken from
the 'libdvb' library by Metzler Brothers. The H.264 parsing routines are taken
from vdr-xineliboutput plugin by Petri Hintukainen.
information).
Terminology:
@@ -110,9 +107,8 @@ Notes:
specifications those values cannot be calculated into any real units.
- If the OSD isn't visible, you've configured the OSD height too big or too
small. Please, try to adjust the variable on the setup page before writing
any bug reports. NTSC users should use a shrinked default OSD height by
modifying VDR's setup.conf: femon.OSDHeight = 420
small. Please, try to adjust the variable on the OSD setup page before
writing any bug reports.
- If the SVDRP service is used: femon won't notice if the server is tuned
to a different channel and tuning the channel on the server might annoy

21
femon.c
View File

@@ -14,11 +14,11 @@
#include "femonservice.h"
#include "femontools.h"
#if defined(APIVERSNUM) && APIVERSNUM < 10600
#error "VDR-1.6.0 API version or greater is required!"
#if defined(APIVERSNUM) && APIVERSNUM < 10700
#error "VDR-1.7.0 API version or greater is required!"
#endif
static const char VERSION[] = "1.6.4";
static const char VERSION[] = "1.7.3";
static const char DESCRIPTION[] = trNOOP("DVB Signal Information Monitor (OSD)");
static const char MAINMENUENTRY[] = trNOOP("Signal Information");
@@ -110,11 +110,8 @@ bool cPluginFemon::SetupParse(const char *Name, const char *Value)
if (!strcasecmp(Name, "HideMenu")) femonConfig.hidemenu = atoi(Value);
else if (!strcasecmp(Name, "DisplayMode")) femonConfig.displaymode = atoi(Value);
else if (!strcasecmp(Name, "Position")) femonConfig.position = atoi(Value);
else if (!strcasecmp(Name, "OSDHeight")) femonConfig.osdheight = atoi(Value);
else if (!strcasecmp(Name, "OSDOffset")) femonConfig.osdoffset = atoi(Value);
else if (!strcasecmp(Name, "Skin")) femonConfig.skin = atoi(Value);
else if (!strcasecmp(Name, "Theme")) femonConfig.theme = atoi(Value);
else if (!strcasecmp(Name, "ShowCASystem")) femonConfig.showcasystem = atoi(Value);
else if (!strcasecmp(Name, "RedLimit")) femonConfig.redlimit = atoi(Value);
else if (!strcasecmp(Name, "GreenLimit")) femonConfig.greenlimit = atoi(Value);
else if (!strcasecmp(Name, "UpdateInterval")) femonConfig.updateinterval = atoi(Value);
@@ -322,15 +319,6 @@ void cMenuFemonSetup::Setup(void)
Add(new cMenuEditBoolItem(tr("Position"), &data.position, trVDR("bottom"), trVDR("top")));
help.Append(tr("Define the position of OSD."));
Add(new cMenuEditIntItem(trVDR("Setup.OSD$Height"), &data.osdheight, 400, 500));
help.Append(tr("Define the height of OSD."));
Add(new cMenuEditIntItem(tr("Horizontal offset"), &data.osdoffset, -50, 50));
help.Append(tr("Define the horizontal offset of OSD."));
Add(new cMenuEditBoolItem(tr("Show CA system"), &data.showcasystem));
help.Append(tr("Define whether the CA system is shown as text."));
Add(new cMenuEditIntItem(tr("Red limit [%]"), &data.redlimit, 1, 50));
help.Append(tr("Define a limit for red bar, which is used to indicate a bad signal."));
@@ -372,9 +360,6 @@ void cMenuFemonSetup::Store(void)
SetupStore("Skin", femonConfig.skin);
SetupStore("Theme", femonConfig.theme);
SetupStore("Position", femonConfig.position);
SetupStore("OSDHeight", femonConfig.osdheight);
SetupStore("OSDOffset", femonConfig.osdoffset);
SetupStore("ShowCASystem", femonConfig.showcasystem);
SetupStore("RedLimit", femonConfig.redlimit);
SetupStore("GreenLimit", femonConfig.greenlimit);
SetupStore("UpdateInterval", femonConfig.updateinterval);

View File

@@ -10,15 +10,25 @@
#define IS_HEAAC_AUDIO(buf) (((buf)[0] == 0xFF) && (((buf)[1] & 0xF6) == 0xF0))
static unsigned int samplerates[16] =
unsigned int cFemonAAC::s_Samplerates[16] =
{
96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, -1, -1, -1, -1
};
bool getAACAudioInfo(uint8_t *buf, int len, audio_info_t *info)
cFemonAAC::cFemonAAC(cFemonAudioIf *audiohandler)
: m_AudioHandler(audiohandler)
{
// HE-AAC audio detection, search for syncword with layer set to 0
if ((len < 4) || !IS_HEAAC_AUDIO(buf))
}
cFemonAAC::~cFemonAAC()
{
}
bool cFemonAAC::processAudio(const uint8_t *buf, int len)
{
cBitStream bs(buf, len * 8);
if (!m_AudioHandler)
return false;
/* ADTS Fixed Header:
@@ -35,41 +45,59 @@ bool getAACAudioInfo(uint8_t *buf, int len, audio_info_t *info)
* emphasis 2b only if ID == 0 (ie MPEG-4)
*/
int sampling_frequency_index = (buf[2] & 0x03C) >> 2;
int channel_configuration = ((buf[2] & 0x01) << 2) | ((buf[3] & 0xC0) >> 6);
// skip PES header
if (!PesLongEnough(len))
return false;
bs.skipBits(8 * PesPayloadOffset(buf));
info->codec = AUDIO_CODEC_HEAAC;
info->bitrate = AUDIO_BITRATE_RESERVED;
// HE-AAC audio detection
if (bs.getBits(12) != 0xFFF) // syncword
return false;
bs.skipBit(); // id
// layer must be 0
if (bs.getBits(2)) // layer
return false;
bs.skipBit(); // protection_absent
bs.skipBits(2); // profile
int sampling_frequency_index = bs.getBits(4); // sampling_frequency_index
bs.skipBit(); // private pid
int channel_configuration = bs.getBits(3); // channel_configuration
m_AudioHandler->SetAudioCodec(AUDIO_CODEC_HEAAC);
m_AudioHandler->SetAudioBitrate(AUDIO_BITRATE_RESERVED);
switch (channel_configuration) {
case 0:
info->channelMode = AUDIO_CHANNEL_MODE_STEREO;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_STEREO);
break;
case 1:
info->channelMode = AUDIO_CHANNEL_MODE_JOINT_STEREO;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_JOINT_STEREO);
break;
case 2:
info->channelMode = AUDIO_CHANNEL_MODE_DUAL;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_DUAL);
break;
case 3:
info->channelMode = AUDIO_CHANNEL_MODE_SINGLE;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_SINGLE);
break;
default:
info->channelMode = AUDIO_CHANNEL_MODE_INVALID;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_INVALID);
break;
}
switch (sampling_frequency_index) {
case 0xC ... 0xF:
info->samplingFrequency = AUDIO_SAMPLING_FREQUENCY_RESERVED;
m_AudioHandler->SetAudioSamplingFrequency(AUDIO_SAMPLING_FREQUENCY_RESERVED);
break;
default:
info->samplingFrequency = samplerates[sampling_frequency_index];
m_AudioHandler->SetAudioSamplingFrequency(s_Samplerates[sampling_frequency_index]);
break;
}

View File

@@ -10,6 +10,17 @@
#include "femonaudio.h"
bool getAACAudioInfo(uint8_t *buf, int len, audio_info_t *info);
class cFemonAAC {
private:
cFemonAudioIf *m_AudioHandler;
static unsigned int s_Samplerates[16];
public:
cFemonAAC(cFemonAudioIf *audiohandler);
virtual ~cFemonAAC();
bool processAudio(const uint8_t *buf, int len);
};
#endif //__FEMONAAC_H

View File

@@ -9,107 +9,85 @@
#include "femontools.h"
#include "femonac3.h"
#define IS_AC3_DATA(buf) (((buf)[0] == 0x0b) && ((buf)[1] == 0x77))
static unsigned int ac3_bitrates[32] =
unsigned int cFemonAC3::s_Bitrates[32] =
{
32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 576, 640, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
static unsigned int ac3_freq[4] =
unsigned int cFemonAC3::s_Frequencies[4] =
{
480, 441, 320, 0
};
//static unsigned int ac3_frames[3][32] =
//{
// {64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1152, 1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
// {69, 87, 104, 121, 139, 174, 208, 243, 278, 348, 417, 487, 557, 696, 835, 975, 1114, 1253, 1393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
// {96, 120, 144, 168, 192, 240, 288, 336, 384, 480, 576, 672, 768, 960, 1152, 1344, 1536, 1728, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
//};
bool getAC3AudioInfo(uint8_t *buf, int len, ac3_info_t *info)
unsigned int cFemonAC3::s_Frames[3][32] =
{
if (!IS_AC3_DATA(buf) || (len < 8))
{64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1152, 1280, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{69, 87, 104, 121, 139, 174, 208, 243, 278, 348, 417, 487, 557, 696, 835, 975, 1114, 1253, 1393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{96, 120, 144, 168, 192, 240, 288, 336, 384, 480, 576, 672, 768, 960, 1152, 1344, 1536, 1728, 1920, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
};
cFemonAC3::cFemonAC3(cFemonAC3If *audiohandler)
: m_AudioHandler(audiohandler)
{
}
cFemonAC3::~cFemonAC3()
{
}
bool cFemonAC3::processAudio(const uint8_t *buf, int len)
{
int fscod, frmsizcod, bsmod, acmod;
int centermixlevel = AUDIO_CENTER_MIX_LEVEL_INVALID;
int surroundmixlevel = AUDIO_SURROUND_MIX_LEVEL_INVALID;
int dolbysurroundmode = AUDIO_DOLBY_SURROUND_MODE_INVALID;
cBitStream bs(buf, len * 8);
if (!m_AudioHandler)
return false;
uint8_t *data = buf + 2;
uint8_t frame = (data[2] & 0x3f);
info->bitrate = 1000 * ac3_bitrates[frame >> 1];
uint8_t fr = (data[2] & 0xc0 ) >> 6;
//uint8_t sz = ac3_frames[fr][frame >> 1];
//if ((frame & 1) && (fr == 1))
// sz++;
//sz <<= 1;
info->samplingFrequency = 100 * ac3_freq[fr];
info->bitstreamMode = (data[3] & 7);
int acm = (data[4] & 0xE0) >> 5;
info->audioCodingMode = acm;
if ((acm & 0x01) && (acm != 0x01)) {
// 3 front channels
info->centerMixLevel = (data[4] & 0x18) >> 3;
if (acm & 0x04) {
// a surround channel exists
info->surroundMixLevel = (data[4] & 0x06) >> 1;
if (acm == 0x02) {
// if in 2/0 mode
info->dolbySurroundMode = ((data[4] & 0x01) << 1) | ((data[5] & 0x80) >> 7);
info->lfe = (data[5] & 0x40) >> 6;
info->dialogLevel = (data[5] & 0x3e) >> 1;
}
else {
info->dolbySurroundMode = AUDIO_DOLBY_SURROUND_MODE_INVALID;
info->lfe = (data[4] & 0x01);
info->dialogLevel = (data[5] & 0xF8) >> 3;
}
}
else {
info->surroundMixLevel = AUDIO_SURROUND_MIX_LEVEL_INVALID;
if (acm == 0x02) {
// if in 2/0 mode
info->dolbySurroundMode = (data[4] & 0x06) >> 1;
info->lfe = (data[4] & 0x01);
info->dialogLevel = (data[5] & 0xF8) >> 3;
}
else {
info->dolbySurroundMode = AUDIO_DOLBY_SURROUND_MODE_INVALID;
info->lfe = (data[4] & 0x04) >> 2;
info->dialogLevel = (data[4] & 0x03) << 3 | ((data[5] & 0xE0) >> 5);
}
}
}
else {
info->centerMixLevel = AUDIO_CENTER_MIX_LEVEL_INVALID;
if (acm & 0x04) {
// a surround channel exists
info->surroundMixLevel = (data[4] & 0x18) >> 3;
if (acm == 0x02) {
// if in 2/0 mode
info->dolbySurroundMode = (data[4] & 0x06) >> 1;
info->lfe = (data[4] & 0x01);
info->dialogLevel = (data[5] & 0xF8) >> 3;
}
else {
info->dolbySurroundMode = AUDIO_DOLBY_SURROUND_MODE_INVALID;
info->lfe = (data[4] & 0x04) >> 2;
info->dialogLevel = (data[4] & 0x03) << 3 | ((data[5] & 0xE0) >> 5);
}
}
else {
info->surroundMixLevel = AUDIO_SURROUND_MIX_LEVEL_INVALID;
if (acm == 0x02) {
// if in 2/0 mode
info->dolbySurroundMode = (data[4] & 0x18) >> 3;
info->lfe = (data[4] & 0x04) >> 2;
info->dialogLevel = (data[4] & 0x03) << 3 | ((data[5] & 0xE0) >> 5);
}
else {
info->dolbySurroundMode = AUDIO_DOLBY_SURROUND_MODE_INVALID;
info->lfe = (data[4] & 0x10) >> 4;
info->dialogLevel = ((data[4] & 0x0F) << 1) | ((data[5] & 0x80) >> 7);
}
}
}
// skip PES header
if (!PesLongEnough(len))
return false;
bs.skipBits(8 * PesPayloadOffset(buf));
// http://rmworkshop.com/dvd_info/related_info/ac3hdr.htm
// AC3 audio detection
if (bs.getU16() != 0x0B77) // syncword
return false;
bs.skipBits(16); // CRC1
fscod = bs.getBits(2); // sampling rate values
frmsizcod = bs.getBits(6); // frame size code
bs.skipBits(5); // bitstream id
bsmod = bs.getBits(3); // bitstream mode
acmod = bs.getBits(3); // audio coding mode
// 3 front channels
if ((acmod & 0x01) && (acmod != 0x01))
centermixlevel = bs.getBits(2);
// if a surround channel exists
if (acmod & 0x04)
surroundmixlevel = bs.getBits(2);
// if in 2/0 mode
if (acmod == 0x02)
dolbysurroundmode = bs.getBits(2);
m_AudioHandler->SetAC3Bitrate(1000 * s_Bitrates[frmsizcod >> 1]);
m_AudioHandler->SetAC3SamplingFrequency(100 * s_Frequencies[fscod]);
m_AudioHandler->SetAC3Bitstream(bsmod);
m_AudioHandler->SetAC3AudioCoding(acmod);
m_AudioHandler->SetAC3CenterMix(centermixlevel);
m_AudioHandler->SetAC3SurroundMix(surroundmixlevel);
m_AudioHandler->SetAC3DolbySurround(dolbysurroundmode);
m_AudioHandler->SetAC3LFE(bs.getBit()); // low frequency effects on
m_AudioHandler->SetAC3Dialog(bs.getBits(5)); // dialog normalization
return true;
}

View File

@@ -10,6 +10,19 @@
#include "femonaudio.h"
bool getAC3AudioInfo(uint8_t *buf, int len, ac3_info_t *info);
class cFemonAC3 {
private:
cFemonAC3If *m_AudioHandler;
static unsigned int s_Bitrates[32];
static unsigned int s_Frequencies[4];
static unsigned int s_Frames[3][32];
public:
cFemonAC3(cFemonAC3If *audiohandler);
virtual ~cFemonAC3();
bool processAudio(const uint8_t *buf, int len);
};
#endif //__FEMONAC3_H

View File

@@ -106,4 +106,44 @@ typedef struct ac3_info {
bool lfe; // boolean
} ac3_info_t;
class cFemonAudioIf {
public:
cFemonAudioIf() {}
virtual ~cFemonAudioIf() {}
// enum
virtual void SetAudioCodec(eAudioCodec codec) = 0;
// kbit/s or eAudioBitrate
virtual void SetAudioBitrate(double bitrate) = 0;
// Hz or eAudioSamplingFrequency
virtual void SetAudioSamplingFrequency(int sampling) = 0;
// eAudioChannelMode
virtual void SetAudioChannel(eAudioChannelMode mode) = 0;
};
class cFemonAC3If {
public:
cFemonAC3If() {}
virtual ~cFemonAC3If() {}
// bit/s or eAudioBitrate
virtual void SetAC3Bitrate(int bitrate) = 0;
// Hz or eAudioSamplingFrequency
virtual void SetAC3SamplingFrequency(int sampling) = 0;
// 0..7 or eAudioBitstreamMode
virtual void SetAC3Bitstream(int mode) = 0;
// 0..7 or eAudioCodingMode
virtual void SetAC3AudioCoding(int mode) = 0;
// eAudioDolbySurroundMode
virtual void SetAC3DolbySurround(int mode) = 0;
// eAudioCenterMixLevel
virtual void SetAC3CenterMix(int level) = 0;
// eAudioSurroundMixLevel
virtual void SetAC3SurroundMix(int level) = 0;
// -dB
virtual void SetAC3Dialog(int level) = 0;
// boolean
virtual void SetAC3LFE(bool onoff) = 0;
};
#endif //__FEMONAUDIO_H

View File

@@ -22,9 +22,6 @@ cFemonConfig::cFemonConfig(void)
updateinterval = 5;
analyzestream = 1;
calcinterval = 20;
showcasystem = 0;
osdheight = 480;
osdoffset = 0;
usesvdrp = 0;
svdrpport = 2001;
strncpy(svdrpip, "0.0.0.0", sizeof(svdrpip));

View File

@@ -33,9 +33,6 @@ public:
int updateinterval;
int analyzestream;
int calcinterval;
int showcasystem;
int osdheight;
int osdoffset;
int usesvdrp;
int svdrpport;
char svdrpip[MaxSvdrpIp + 1]; // must end with additional null

View File

@@ -4,29 +4,13 @@
* See the README file for copyright information and how to reach the author.
*
* The original NAL SPS parsing and bitstream functions are taken from
* vdr-xineliboutput plugin by Petri Hintukainen.
* vdr-xineliboutput plugin by Petri Hintukainen.
*/
#include "femontools.h"
#include "femonh264.h"
#define NAL_SEI 0x06 // Supplemental Enhancement Information
#define NAL_SPS 0x07 // Sequence Parameter Set
#define NAL_AUD 0x09 // Access Unit Delimiter
#define NAL_END_SEQ 0x10 // End of Sequence
#define IS_NAL_SEI(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == NAL_SEI))
#define IS_NAL_SPS(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == NAL_SPS))
#define IS_NAL_AUD(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == NAL_AUD))
#define IS_NAL_END_SEQ(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == NAL_END_SEQ))
// Picture types
#define NO_PICTURE 0
#define I_FRAME 1
#define P_FRAME 2
#define B_FRAME 3
static const eVideoAspectRatio aspect_ratios[] =
const eVideoAspectRatio cFemonH264::s_AspectRatios[] =
{
VIDEO_ASPECT_RATIO_INVALID,
VIDEO_ASPECT_RATIO_1_1,
@@ -47,7 +31,7 @@ static const eVideoAspectRatio aspect_ratios[] =
VIDEO_ASPECT_RATIO_2_1
};
static const eVideoFormat video_formats[] =
const eVideoFormat cFemonH264::s_VideoFormats[] =
{
VIDEO_FORMAT_COMPONENT,
VIDEO_FORMAT_PAL,
@@ -58,281 +42,128 @@ static const eVideoFormat video_formats[] =
VIDEO_FORMAT_RESERVED
};
typedef struct {
int width;
int height;
eVideoAspectRatio aspect_ratio;
eVideoFormat format;
} h264_sps_data_t;
typedef struct {
double frame_rate;
double bitrate;
eVideoScan scan;
} h264_sei_data_t;
typedef struct {
const uint8_t *data;
int count; // bits
int index; // bits
} br_state;
#define BR_INIT(data, bytes) { (data), 8 * (bytes), 0 }
#define BR_EOF(br) ((br)->index >= (br)->count)
#define br_skip_bit(br) br_skip_bits(br,1)
#define br_get_u8(br) br_get_bits(br, 8)
#define br_get_u16(br) ((br_get_bits(br, 8) << 8) | br_get_bits(br, 8))
#define br_skip_ue_golomb(br) br_skip_golomb(br)
#define br_skip_se_golomb(br) br_skip_golomb(br)
static inline void br_init(br_state *br, const uint8_t *data, int bytes)
const uint8_t cFemonH264::s_SeiNumClockTsTable[9] =
{
1, 1, 1, 2, 2, 3, 3, 2, 3
};
cFemonH264::cFemonH264(cFemonVideoIf *videohandler)
: m_VideoHandler(videohandler),
m_Width(0),
m_Height(0),
m_AspectRatio(VIDEO_ASPECT_RATIO_INVALID),
m_Format(VIDEO_FORMAT_INVALID),
m_FrameRate(0),
m_BitRate(0),
m_Scan(VIDEO_SCAN_INVALID),
m_CpbDpbDelaysPresentFlag(false),
m_PicStructPresentFlag(false),
m_TimeOffsetLength(0)
{
br->data = data;
br->count = 8 * bytes;
br->index = 0;
}
static inline int br_get_bit(br_state *br)
cFemonH264::~cFemonH264()
{
if (br->index >= br->count)
return 1; // -> no infinite colomb's ...
int r = (br->data[br->index >> 3] >> (7 - (br->index & 7))) & 1;
br->index++;
return r;
}
static inline uint32_t br_get_bits(br_state *br, uint32_t n)
bool cFemonH264::processVideo(const uint8_t *buf, int len)
{
uint32_t r = 0;
while (n--)
r = r | (br_get_bit(br) << n);
return r;
}
uint8_t nal_data[len];
bool aud_found = false, sps_found = false, sei_found = false;
const uint8_t *start = buf;
const uint8_t *end = start + len;
static inline void br_skip_bits(br_state *br, int n)
{
br->index += n;
}
static inline uint32_t br_get_ue_golomb(br_state *br)
{
int n = 0;
while (!br_get_bit(br) && (n < 32))
n++;
return n ? ((1 << n) - 1) + br_get_bits(br, n) : 0;
}
static inline int32_t br_get_se_golomb(br_state *br)
{
uint32_t r = br_get_ue_golomb(br) + 1;
return (r & 1) ? -(r >> 1) : (r >> 1);
}
static inline void br_skip_golomb(br_state *br)
{
int n = 0;
while (!br_get_bit(br) && (n < 32))
n++;
br_skip_bits(br, n);
}
static inline void br_byte_align(br_state *br)
{
int n = br->index % 8;
if (n > 0)
br_skip_bits(br, 8 - n);
}
static bool h264_parse_sps(const uint8_t *buf, int len, h264_sps_data_t *sps)
{
br_state br = BR_INIT(buf, len);
int profile_idc, pic_order_cnt_type;
int frame_mbs_only;
int i, j;
profile_idc = br_get_u8(&br);
//Dprintf("H.264 SPS: profile_idc %d", profile_idc);
br_skip_bits(&br, 16);
br_skip_ue_golomb(&br); // seq_parameter_set_id
if (profile_idc >= 100) {
if (br_get_ue_golomb(&br) == 3) // chroma_format_idc
br_skip_bit(&br); // residual_colour_transform_flag
br_skip_ue_golomb(&br); // bit_depth_luma - 8
br_skip_ue_golomb(&br); // bit_depth_chroma - 8
br_skip_bit(&br); // transform_bypass
if (br_get_bit(&br)) { // seq_scaling_matrix_present
for (i = 0; i < 8; i++) {
if (br_get_bit(&br)) { // seq_scaling_list_present
int last = 8, next = 8, size = (i < 6) ? 16 : 64;
for (j = 0; j < size; j++) {
if (next)
next = (last + br_get_se_golomb(&br)) & 0xff;
last = next ?: last;
}
}
}
}
}
br_skip_ue_golomb(&br); // log2_max_frame_num - 4
pic_order_cnt_type = br_get_ue_golomb(&br);
if (pic_order_cnt_type == 0)
br_skip_ue_golomb(&br); // log2_max_poc_lsb - 4
else if (pic_order_cnt_type == 1) {
br_skip_bit(&br); // delta_pic_order_always_zero
br_skip_se_golomb(&br); // offset_for_non_ref_pic
br_skip_se_golomb(&br); // offset_for_top_to_bottom_field
j = br_get_ue_golomb(&br); // num_ref_frames_in_pic_order_cnt_cycle
for (i = 0; i < j; i++)
br_skip_se_golomb(&br); // offset_for_ref_frame[i]
}
br_skip_ue_golomb(&br); // ref_frames
br_skip_bit(&br); // gaps_in_frame_num_allowed
sps->width = br_get_ue_golomb(&br) + 1; // mbs
sps->height = br_get_ue_golomb(&br) + 1; // mbs
frame_mbs_only = br_get_bit(&br);
//Dprintf("H.264 SPS: pic_width: %u mbs", (unsigned int)sps->width);
//Dprintf("H.264 SPS: pic_height: %u mbs", (unsigned int)sps->height);
//Dprintf("H.264 SPS: frame only flag: %d", frame_mbs_only);
sps->width *= 16;
sps->height *= 16 * (2 - frame_mbs_only);
if (!frame_mbs_only) {
if (br_get_bit(&br)) { // mb_adaptive_frame_field_flag
//Dprintf("H.264 SPS: MBAFF");
}
}
br_skip_bit(&br); // direct_8x8_inference_flag
if (br_get_bit(&br)) { // frame_cropping_flag
uint32_t crop_left = br_get_ue_golomb(&br);
uint32_t crop_right = br_get_ue_golomb(&br);
uint32_t crop_top = br_get_ue_golomb(&br);
uint32_t crop_bottom = br_get_ue_golomb(&br);
//Dprintf("H.264 SPS: cropping %d %d %d %d", crop_left, crop_top, crop_right, crop_bottom);
sps->width -= 2 * (crop_left + crop_right);
if (frame_mbs_only)
sps->height -= 2 * (crop_top + crop_bottom);
else
sps->height -= 4 * (crop_top + crop_bottom);
}
// VUI parameters
sps->aspect_ratio = VIDEO_ASPECT_RATIO_INVALID;
sps->format = VIDEO_FORMAT_INVALID;
if (br_get_bit(&br)) { // vui_parameters_present_flag
if (br_get_bit(&br)) { // aspect_ratio_info_present
uint32_t aspect_ratio_idc = br_get_u8(&br);
//Dprintf("H.264 SPS: aspect_ratio_idc %d", aspect_ratio_idc);
if (aspect_ratio_idc == 255) { // extended sar
br_skip_bit(&br); // sar_width
br_skip_bit(&br); // sar_height
sps->aspect_ratio = VIDEO_ASPECT_RATIO_EXTENDED;
//Dprintf("H.264 SPS: aspect ratio extended");
}
else if (aspect_ratio_idc < sizeof(aspect_ratios) / sizeof(aspect_ratios[0])) {
sps->aspect_ratio = aspect_ratios[aspect_ratio_idc];
//Dprintf("H.264 SPS: -> aspect ratio %d", sps->aspect_ratio);
}
}
if (br_get_bit(&br)) // overscan_info_present_flag
br_skip_bit(&br); // overscan_approriate_flag
if (br_get_bit(&br)) { // video_signal_type_present_flag
uint32_t video_format = br_get_bits(&br, 3);
if (video_format < sizeof(video_formats) / sizeof(video_formats[0])) {
sps->format = video_formats[video_format];
//Dprintf("H.264 SPS: -> video format %d", sps->format);
}
}
}
//Dprintf("H.264 SPS: -> video size %dx%d, aspect %d", sps->width, sps->height, sps->aspect_ratio);
if (BR_EOF(&br)) {
//Dprintf("H.264 SPS: not enough data ?");
if (!m_VideoHandler)
return false;
}
return true;
}
static bool h264_parse_sei(const uint8_t *buf, int len, h264_sei_data_t *sei)
{
int num_referenced_subseqs, i;
br_state br = BR_INIT(buf, len);
// skip PES header
if (!PesLongEnough(len))
return false;
buf += PesPayloadOffset(buf);
start = buf;
while (!BR_EOF(&br)) { // sei_message
int lastByte, payloadSize = 0, payloadType = 0;
for (;;) {
int consumed = 0;
// last_payload_type_byte
do {
lastByte = br_get_u8(&br) & 0xFF;
payloadType += lastByte;
} while (lastByte == 0xFF);
buf = nextStartCode(buf, end);
if (buf >= end)
break;
// last_payload_size_byte
do {
lastByte = br_get_u8(&br) & 0xFF;
payloadSize += lastByte;
} while (lastByte == 0xFF);
switch (buf[3] & 0x1F) {
case NAL_AUD:
if (!aud_found) {
switch (buf[4] >> 5) {
case 0: case 3: case 5: // I_FRAME
//Dprintf("H.264: Found NAL AUD at offset %d/%d", buf - start, len);
aud_found = true;
break;
case 1: case 4: case 6: // P_FRAME;
case 2: case 7: // B_FRAME;
default: // NO_PICTURE;
break;
}
}
break;
switch (payloadType) { // sei_payload
//case 1: // pic_timing
// ...
// switch (br_get_bits(&br, 2)) { // ct_type
// case 0:
// sei->scan = VIDEO_SCAN_PROGRESSIVE;
// break;
// case 1:
// sei->scan = VIDEO_SCAN_INTERLACED;
// break;
// case 2:
// sei->scan = VIDEO_SCAN_UNKNOWN;
// break;
// default:
// sei->scan = VIDEO_SCAN_RESERVED;
// break;
// }
// break;
case NAL_SPS:
if (!sps_found) {
//Dprintf("H.264: Found NAL SPS at offset %d/%d", buf - start, len);
int nal_len = nalUnescape(nal_data, buf + 4, int(end - buf - 4));
consumed = parseSPS(nal_data, nal_len);
if (consumed > 0)
sps_found = true;
}
break;
#if 0
case NAL_SEI:
if (!sei_found) {
//Dprintf("H.264: Found NAL SEI at offset %d/%d", buf - start, len);
int nal_len = nalUnescape(nal_data, buf + 4, int(end - buf - 4));
consumed = parseSEI(nal_data, nal_len);
if (consumed > 0)
sei_found = true;
}
break;
#endif
default:
break;
}
case 12: // sub_seq_characteristics
br_skip_ue_golomb(&br); // sub_seq_layer_num
br_skip_ue_golomb(&br); // sub_seq_id
if (br_get_bit(&br)) // duration_flag
br_skip_bits(&br, 32); // sub_seq_duration
if (br_get_bit(&br)) { // average_rate_flag
br_skip_bit(&br); // accurate_statistics_flag
sei->bitrate = br_get_u16(&br); // average_bit_rate
sei->frame_rate = br_get_u16(&br); // average_frame_rate
//Dprintf("H.264 SEI: -> stream bitrate %.1f, frame rate %.1f", sei->bitrate, sei->frame_rate);
}
num_referenced_subseqs = br_get_ue_golomb(&br); // num_referenced_subseqs
for (i = 0; i < num_referenced_subseqs; ++i) {
br_skip_ue_golomb(&br); // ref_sub_seq_layer_num
br_skip_ue_golomb(&br); // ref_sub_seq_id
br_get_bit(&br); // ref_sub_seq_direction
}
break;
if (aud_found && sps_found && sei_found)
break;
default:
br_skip_bits(&br, payloadSize);
break;
buf += consumed + 4;
}
// force byte align
br_byte_align(&br);
}
if (aud_found) {
m_VideoHandler->SetVideoCodec(VIDEO_CODEC_H264);
if (sps_found) {
//Dprintf("H.264 SPS: -> video size %dx%d, aspect %d format %d", m_Width, m_Height, m_AspectRatio, m_Format);
m_VideoHandler->SetVideoFormat(m_Format);
m_VideoHandler->SetVideoSize(m_Width, m_Height);
m_VideoHandler->SetVideoAspectRatio(m_AspectRatio);
}
if (sei_found) {
//Dprintf("H.264 SEI: -> stream bitrate %.1f, frame rate %.1f scan %d", m_BitRate, m_FrameRate, m_Scan);
m_VideoHandler->SetVideoFramerate(m_FrameRate);
m_VideoHandler->SetVideoBitrate(m_BitRate);
m_VideoHandler->SetVideoScan(m_Scan);
}
}
return true;
return aud_found;
}
static int h264_nal_unescape(uint8_t *dst, const uint8_t *src, int len)
const uint8_t *cFemonH264::nextStartCode(const uint8_t *start, const uint8_t *end)
{
for (end -= 3; start < end; ++start) {
if ((start[0] == 0x00) && (start[1] == 0x00) && (start[2] == 0x01))
return start;
}
return (end + 3);
}
int cFemonH264::nalUnescape(uint8_t *dst, const uint8_t *src, int len)
{
int s = 0, d = 0;
@@ -350,76 +181,306 @@ static int h264_nal_unescape(uint8_t *dst, const uint8_t *src, int len)
}
dst[d++] = src[s++];
}
return d;
}
static int h264_get_picture_type(const uint8_t *buf, int len)
int cFemonH264::parseSPS(const uint8_t *buf, int len)
{
for (int i = 0; i < (len - 5); ++i) {
if (buf[i] == 0 && buf[i + 1] == 0 && buf[i + 2] == 1 && buf[i + 3] == NAL_AUD) {
uint8_t type = (buf[i + 4] >> 5);
switch (type) {
case 0: case 3: case 5: return I_FRAME;
case 1: case 4: case 6: return P_FRAME;
case 2: case 7: return B_FRAME;
default:;
int profile_idc, pic_order_cnt_type, frame_mbs_only, i, j;
cBitStream bs(buf, len);
unsigned int width = m_Width;
unsigned int height = m_Height;
eVideoAspectRatio aspect_ratio = m_AspectRatio;
eVideoFormat format = m_Format;
bool cpb_dpb_delays_present_flag = m_CpbDpbDelaysPresentFlag;
bool pic_struct_present_flag = m_PicStructPresentFlag;
unsigned int time_offset_length = m_TimeOffsetLength;
profile_idc = bs.getU8();
//Dprintf("H.264 SPS: profile_idc %d", profile_idc);
bs.skipBits(16);
bs.skipUeGolomb(); // seq_parameter_set_id
if (profile_idc >= 100) {
if (bs.getUeGolomb() == 3) // chroma_format_idc
bs.skipBit(); // residual_colour_transform_flag
bs.skipUeGolomb(); // bit_depth_luma - 8
bs.skipUeGolomb(); // bit_depth_chroma - 8
bs.skipBit(); // transform_bypass
if (bs.getBit()) { // seq_scaling_matrix_present
for (i = 0; i < 8; i++) {
if (bs.getBit()) { // seq_scaling_list_present
int last = 8, next = 8, size = (i < 6) ? 16 : 64;
for (j = 0; j < size; j++) {
if (next)
next = (last + bs.getSeGolomb()) & 0xff;
last = next ?: last;
}
}
}
}
}
bs.skipUeGolomb(); // log2_max_frame_num - 4
pic_order_cnt_type = bs.getUeGolomb();
if (pic_order_cnt_type == 0)
bs.skipUeGolomb(); // log2_max_poc_lsb - 4
else if (pic_order_cnt_type == 1) {
bs.skipBit(); // delta_pic_order_always_zero
bs.skipSeGolomb(); // offset_for_non_ref_pic
bs.skipSeGolomb(); // offset_for_top_to_bottom_field
j = bs.getUeGolomb(); // num_ref_frames_in_pic_order_cnt_cycle
for (i = 0; i < j; i++)
bs.skipSeGolomb(); // offset_for_ref_frame[i]
}
bs.skipUeGolomb(); // ref_frames
bs.skipBit(); // gaps_in_frame_num_allowed
width = bs.getUeGolomb() + 1; // mbs
height = bs.getUeGolomb() + 1; // mbs
frame_mbs_only = bs.getBit();
//Dprintf("H.264 SPS: pic_width: %u mbs", width);
//Dprintf("H.264 SPS: pic_height: %u mbs", height);
//Dprintf("H.264 SPS: frame only flag: %d", frame_mbs_only);
width *= 16;
height *= 16 * (2 - frame_mbs_only);
if (!frame_mbs_only) {
if (bs.getBit()) { // mb_adaptive_frame_field_flag
//Dprintf("H.264 SPS: MBAFF");
}
}
bs.skipBit(); // direct_8x8_inference_flag
if (bs.getBit()) { // frame_cropping_flag
uint32_t crop_left = bs.getUeGolomb();
uint32_t crop_right = bs.getUeGolomb();
uint32_t crop_top = bs.getUeGolomb();
uint32_t crop_bottom = bs.getUeGolomb();
//Dprintf("H.264 SPS: cropping %d %d %d %d", crop_left, crop_top, crop_right, crop_bottom);
width -= 2 * (crop_left + crop_right);
if (frame_mbs_only)
height -= 2 * (crop_top + crop_bottom);
else
height -= 4 * (crop_top + crop_bottom);
}
// VUI parameters
if (bs.getBit()) { // vui_parameters_present_flag
if (bs.getBit()) { // aspect_ratio_info_present
uint32_t aspect_ratio_idc = bs.getU8();
//Dprintf("H.264 SPS: aspect_ratio_idc %d", aspect_ratio_idc);
if (aspect_ratio_idc == 255) { // extended sar
bs.skipBit(); // sar_width
bs.skipBit(); // sar_height
aspect_ratio = VIDEO_ASPECT_RATIO_EXTENDED;
//Dprintf("H.264 SPS: aspect ratio extended");
}
}
}
return NO_PICTURE;
else if (aspect_ratio_idc < sizeof(s_AspectRatios) / sizeof(s_AspectRatios[0])) {
aspect_ratio = s_AspectRatios[aspect_ratio_idc];
//Dprintf("H.264 SPS: -> aspect ratio %d", aspect_ratio);
}
}
if (bs.getBit()) // overscan_info_present_flag
bs.skipBit(); // overscan_approriate_flag
if (bs.getBit()) { // video_signal_type_present_flag
uint32_t video_format;
video_format = bs.getBits(3); // video_format
if (video_format < sizeof(s_VideoFormats) / sizeof(s_VideoFormats[0])) {
format = s_VideoFormats[video_format];
//Dprintf("H.264 SPS: -> video format %d", format);
}
bs.skipBit(); // video_full_range_flag
bs.skipBit(); // video_full_range_flag
if (bs.getBit()) { // colour_description_present_flag
bs.skipBits(8); // colour_primaries
bs.skipBits(8); // transfer_characteristics
bs.skipBits(8); // matrix_coefficients
}
}
if (bs.getBit()) { // chroma_loc_info_present_flag
bs.skipUeGolomb(); // chroma_sample_loc_type_top_field
bs.skipUeGolomb(); // chroma_sample_loc_type_bottom_field
}
if (bs.getBit()) { // timing_info_present_flag
bs.skipBits(32); // num_units_in_tick
bs.skipBits(32); // time_scale
bs.skipBit(); // fixed_frame_rate_flag
}
int nal_hrd_parameters_present_flag = bs.getBit(); // nal_hrd_parameters_present_flag
if (nal_hrd_parameters_present_flag) {
int cpb_cnt_minus1;
cpb_cnt_minus1 = bs.getUeGolomb(); // cpb_cnt_minus1
bs.skipBits(4); // bit_rate_scale
bs.skipBits(4); // cpb_size_scale
for (int i = 0; i < cpb_cnt_minus1; ++i) {
bs.skipUeGolomb(); // bit_rate_value_minus1[i]
bs.skipUeGolomb(); // cpb_size_value_minus1[i]
bs.skipBit(); // cbr_flag[i]
}
bs.skipBits(5); // initial_cpb_removal_delay_length_minus1
bs.skipBits(5); // cpb_removal_delay_length_minus1
bs.skipBits(5); // dpb_output_delay_length_minus1
time_offset_length = bs.getBits(5); // time_offset_length
}
int vlc_hrd_parameters_present_flag = bs.getBit(); // vlc_hrd_parameters_present_flag
if (vlc_hrd_parameters_present_flag) {
int cpb_cnt_minus1;
cpb_cnt_minus1 = bs.getUeGolomb(); // cpb_cnt_minus1
bs.skipBits(4); // bit_rate_scale
bs.skipBits(4); // cpb_size_scale
for (int i = 0; i < cpb_cnt_minus1; ++i) {
bs.skipUeGolomb(); // bit_rate_value_minus1[i]
bs.skipUeGolomb(); // cpb_size_value_minus1[i]
bs.skipBit(); // cbr_flag[i]
}
bs.skipBits(5); // initial_cpb_removal_delay_length_minus1
bs.skipBits(5); // cpb_removal_delay_length_minus1
bs.skipBits(5); // dpb_output_delay_length_minus1
time_offset_length = bs.getBits(5); // time_offset_length
}
cpb_dpb_delays_present_flag = (nal_hrd_parameters_present_flag | vlc_hrd_parameters_present_flag);
if (cpb_dpb_delays_present_flag)
bs.skipBit(); // low_delay_hrd_flag
pic_struct_present_flag = bs.getBit(); // pic_struct_present_flag
if (bs.getBit()) { // bitstream_restriction_flag
bs.skipBit(); // motion_vectors_over_pic_boundaries_flag
bs.skipUeGolomb(); // max_bytes_per_pic_denom
bs.skipUeGolomb(); // max_bits_per_mb_denom
bs.skipUeGolomb(); // log2_max_mv_length_horizontal
bs.skipUeGolomb(); // log2_max_mv_length_vertical
bs.skipUeGolomb(); // num_reorder_frames
bs.skipUeGolomb(); // max_dec_frame_buffering
}
}
m_Width = width;
m_Height = height;
m_AspectRatio = aspect_ratio;
m_Format = format;
m_CpbDpbDelaysPresentFlag = cpb_dpb_delays_present_flag;
m_PicStructPresentFlag = pic_struct_present_flag;
m_TimeOffsetLength = time_offset_length;
return (bs.getIndex() / 8);
}
bool getH264VideoInfo(uint8_t *buf, int len, video_info_t *info)
int cFemonH264::parseSEI(const uint8_t *buf, int len)
{
bool sps_found = false, sei_found = true; // sei currently disabled
int num_referenced_subseqs, i;
cBitStream bs(buf, len);
// H.264 detection, search for NAL AUD
if (!IS_NAL_AUD(buf))
return false;
double frame_rate = m_FrameRate;
double bit_rate = m_BitRate;
eVideoScan scan = m_Scan;
// If I-frame, search for NAL SPS
if (h264_get_picture_type(buf, len) != I_FRAME)
return false;
while ((bs.getIndex() * 8 + 16) < len) { // sei_message
int lastByte, payloadSize = 0, payloadType = 0;
info->codec = VIDEO_CODEC_H264;
// last_payload_type_byte
do {
lastByte = bs.getU8() & 0xFF;
payloadType += lastByte;
} while (lastByte == 0xFF);
// Scan video packet ...
for (int i = 5; i < len - 4; i++) {
// ... for sequence parameter set
if (!sps_found && (buf[i] == 0x00) && (buf[i + 1] == 0x00) && (buf[i + 2] == 0x01) && (buf[i + 3] & 0x1f) == NAL_SPS) {
uint8_t nal_data[len];
int nal_len;
//Dprintf("H.264: Found NAL SPS at offset %d/%d", i, len);
if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) {
h264_sps_data_t sps = { 0 };
if (h264_parse_sps(nal_data, nal_len, &sps)) {
info->format = sps.format;
info->width = sps.width;
info->height = sps.height;
info->aspectRatio = sps.aspect_ratio;
sps_found = true;
// last_payload_size_byte
do {
lastByte = bs.getU8() & 0xFF;
payloadSize += lastByte;
} while (lastByte == 0xFF);
switch (payloadType) { // sei_payload
case 1: // pic_timing
if (m_CpbDpbDelaysPresentFlag) { // cpb_dpb_delays_present_flag
bs.skipUeGolomb(); // cpb_removal_delay
bs.skipUeGolomb(); // dpb_output_delay
}
if (m_PicStructPresentFlag) { // pic_struct_present_flag
unsigned int pic_struct = bs.getBits(4); // pic_struct
if (pic_struct >= (sizeof(s_SeiNumClockTsTable) ) / sizeof(s_SeiNumClockTsTable[0]))
return 0;
for (int i = 0; i < s_SeiNumClockTsTable[pic_struct]; ++i) {
if (bs.getBit()) { // clock_timestamp_flag[i]
int full_timestamp_flag;
switch (bs.getBits(2)) { // ct_type
case 0:
scan = VIDEO_SCAN_PROGRESSIVE;
break;
case 1:
scan = VIDEO_SCAN_INTERLACED;
break;
case 2:
scan = VIDEO_SCAN_UNKNOWN;
break;
default:
scan = VIDEO_SCAN_RESERVED;
break;
}
//Dprintf("\nH.264 SEI: -> scan type %d", bit_rate, scan);
bs.skipBit(); // nuit_field_based_flag
bs.skipBits(5); // counting_type
full_timestamp_flag = bs.getBit(); // full_timestamp_flag
bs.skipBit(); // discontinuity_flag
bs.skipBit(); // cnt_dropped_flag
bs.skipBits(8); // n_frames
if (full_timestamp_flag) {
bs.skipBits(6); // seconds_value
bs.skipBits(6); // minutes_value
bs.skipBits(5); // hours_value
}
else {
if (bs.getBit()) { // seconds_flag
bs.skipBits(6); // seconds_value
if (bs.getBit()) { // minutes_flag
bs.skipBits(6); // minutes_value
if (bs.getBit()) // hours_flag
bs.skipBits(5); // hours_value
}
}
}
if (m_TimeOffsetLength > 0)
bs.skipBits(m_TimeOffsetLength); // time_offset
}
}
}
break;
case 12: // sub_seq_characteristics
bs.skipUeGolomb(); // sub_seq_layer_num
bs.skipUeGolomb(); // sub_seq_id
if (bs.getBit()) // duration_flag
bs.skipBits(32); // sub_seq_duration
if (bs.getBit()) { // average_rate_flag
bs.skipBit(); // accurate_statistics_flag
bit_rate = bs.getU16() / 1048.51; // average_bit_rate (1000 bit/s -> Mbit/s)
frame_rate = bs.getU16() / 256.0; // average_frame_rate (frames/256s)
//Dprintf("\nH.264 SEI: -> stream bitrate %.1f, frame rate %.1f", bit_rate, frame_rate);
}
num_referenced_subseqs = bs.getUeGolomb(); // num_referenced_subseqs
for (i = 0; i < num_referenced_subseqs; ++i) {
bs.skipUeGolomb(); // ref_sub_seq_layer_num
bs.skipUeGolomb(); // ref_sub_seq_id
bs.getBit(); // ref_sub_seq_direction
}
}
}
// ... for supplemental enhancement information
if (!sei_found && (buf[i] == 0x00) && (buf[i + 1] == 0x00) && (buf[i + 2] == 0x01) && (buf[i + 3] & 0x1f) == NAL_SEI) {
uint8_t nal_data[len];
int nal_len;
//Dprintf("H.264: Found NAL SEI at offset %d/%d", i, len);
if (0 < (nal_len = h264_nal_unescape(nal_data, buf + i + 4, len - i - 4))) {
h264_sei_data_t sei = { 0 };
if (h264_parse_sei(nal_data, nal_len, &sei)) {
info->frameRate = sei.frame_rate;
info->bitrate = sei.bitrate;
info->scan = sei.scan;
sei_found = true;
}
}
}
if (sps_found && sei_found)
break;
break;
default:
bs.skipBits(payloadSize * 8);
break;
}
return true;
// force byte align
bs.byteAlign();
}
m_FrameRate = frame_rate;
m_BitRate = bit_rate;
m_Scan = scan;
return (bs.getIndex() / 8);
}

View File

@@ -10,6 +10,41 @@
#include "femonvideo.h"
bool getH264VideoInfo(uint8_t *buf, int len, video_info_t *info);
class cFemonH264 {
private:
enum {
NAL_SEI = 0x06, // Supplemental Enhancement Information
NAL_SPS = 0x07, // Sequence Parameter Set
NAL_AUD = 0x09, // Access Unit Delimiter
NAL_END_SEQ = 0x0A // End of Sequence
};
cFemonVideoIf *m_VideoHandler;
unsigned int m_Width;
unsigned int m_Height;
eVideoAspectRatio m_AspectRatio;
eVideoFormat m_Format;
double m_FrameRate;
double m_BitRate;
eVideoScan m_Scan;
bool m_CpbDpbDelaysPresentFlag;
bool m_PicStructPresentFlag;
unsigned int m_TimeOffsetLength;
const uint8_t *nextStartCode(const uint8_t *start, const uint8_t *end);
int nalUnescape(uint8_t *dst, const uint8_t *src, int len);
int parseSPS(const uint8_t *buf, int len);
int parseSEI(const uint8_t *buf, int len);
static const eVideoAspectRatio s_AspectRatios[];
static const eVideoFormat s_VideoFormats[];
static const uint8_t s_SeiNumClockTsTable[9];
public:
cFemonH264(cFemonVideoIf *videohandler);
virtual ~cFemonH264();
bool processVideo(const uint8_t *buf, int len);
};
#endif //__FEMONH264_H

View File

@@ -8,10 +8,9 @@
#include "femontools.h"
#include "femonmpeg.h"
#define IS_MPEG_AUDIO(buf) (((buf)[0] == 0xFF) && ((buf)[1] & 0xF0))
#define IS_SEQUENCE_HEADER(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == 0xB3))
#define IS_EXTENSION_START(buf) (((buf)[0] == 0x00) && ((buf)[1] == 0x00) && ((buf)[2] == 0x01) && ((buf)[3] == 0xB5))
static unsigned int bitrates[2][3][16] =
unsigned int cFemonMPEG::s_Bitrates[2][3][16] =
{
{
{0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, -1}, // MPEG-2 Layer I
@@ -25,160 +24,263 @@ static unsigned int bitrates[2][3][16] =
}
};
static unsigned int samplerates[2][4] =
unsigned int cFemonMPEG::s_Samplerates[2][4] =
{
{22050, 24000, 16000, -1}, // MPEG-2
{44100, 48000, 32000, -1} // MPEG-1
};
static eAudioCodec formats[2][4] =
eAudioCodec cFemonMPEG::s_Formats[2][4] =
{
{AUDIO_CODEC_MPEG2_I, AUDIO_CODEC_MPEG2_II, AUDIO_CODEC_MPEG2_III, AUDIO_CODEC_UNKNOWN}, // MPEG-2
{AUDIO_CODEC_MPEG1_I, AUDIO_CODEC_MPEG1_II, AUDIO_CODEC_MPEG1_III, AUDIO_CODEC_UNKNOWN} // MPEG-1
};
bool getMPEGAudioInfo(uint8_t *buf, int len, audio_info_t *info)
cFemonMPEG::cFemonMPEG(cFemonVideoIf *videohandler, cFemonAudioIf *audiohandler)
: m_VideoHandler(videohandler),
m_AudioHandler(audiohandler)
{
// MPEG audio detection, search for syncword
if ((len < 4) || !IS_MPEG_AUDIO(buf))
}
cFemonMPEG::~cFemonMPEG()
{
}
bool cFemonMPEG::processAudio(const uint8_t *buf, int len)
{
cBitStream bs(buf, len * 8);
if (!m_AudioHandler)
return false;
int mpegIndex = (buf[1] & 0x08) >> 3; // MPEG-2=0, MPEG-1=1
int layerIndex = 3 - ((buf[1] & 0x06) >> 1); // I=11, II=10, III=01
int bitrateIndex = (buf[2] & 0xF0) >> 4;
int frequency = (buf[2] & 0x0C) >> 2;
int channelMode = (buf[3] & 0xC0) >> 6;
// skip PES header
if (!PesLongEnough(len))
return false;
bs.skipBits(8 * PesPayloadOffset(buf));
info->codec = formats[mpegIndex][layerIndex];
// MPEG audio detection
if (bs.getBits(12) != 0xFFF) // syncword
return false;
switch (channelMode) {
int id = bs.getBit(); // id: MPEG-2=0, MPEG-1=1
int layer = 3 - bs.getBits(2); // layer: I=11, II=10, III=01
bs.skipBit(); // protection bit
int bit_rate_index = bs.getBits(4); // bitrate index
int sampling_frequency = bs.getBits(2); // sampling frequency
bs.skipBit(); // padding bit
bs.skipBit(); // private pid
int mode = bs.getBits(2); // mode
m_AudioHandler->SetAudioCodec(s_Formats[id][layer]);
switch (mode) {
case 0:
info->channelMode = AUDIO_CHANNEL_MODE_STEREO;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_STEREO);
break;
case 1:
info->channelMode = AUDIO_CHANNEL_MODE_JOINT_STEREO;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_JOINT_STEREO);
break;
case 2:
info->channelMode = AUDIO_CHANNEL_MODE_DUAL;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_DUAL);
break;
case 3:
info->channelMode = AUDIO_CHANNEL_MODE_SINGLE;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_SINGLE);
break;
default:
info->channelMode = AUDIO_CHANNEL_MODE_INVALID;
m_AudioHandler->SetAudioChannel(AUDIO_CHANNEL_MODE_INVALID);
break;
}
switch (bitrateIndex) {
switch (bit_rate_index) {
case 0:
info->bitrate = AUDIO_BITRATE_FREE;
m_AudioHandler->SetAudioBitrate(AUDIO_BITRATE_FREE);
break;
case 0xF:
info->bitrate = AUDIO_BITRATE_RESERVED;
m_AudioHandler->SetAudioBitrate(AUDIO_BITRATE_RESERVED);
break;
default:
info->bitrate = 1000 * bitrates[mpegIndex][layerIndex][bitrateIndex];
m_AudioHandler->SetAudioBitrate(1000 * s_Bitrates[id][layer][bit_rate_index]);
break;
}
switch (frequency) {
switch (sampling_frequency) {
case 3:
info->samplingFrequency = AUDIO_SAMPLING_FREQUENCY_RESERVED;
m_AudioHandler->SetAudioSamplingFrequency(AUDIO_SAMPLING_FREQUENCY_RESERVED);
break;
default:
info->samplingFrequency = samplerates[mpegIndex][frequency];
m_AudioHandler->SetAudioSamplingFrequency(s_Samplerates[id][sampling_frequency]);
break;
}
return true;
}
bool getMPEGVideoInfo(uint8_t *buf, int len, video_info_t *info)
bool cFemonMPEG::processVideo(const uint8_t *buf, int len)
{
// MPEG-2 video detection, search for sequence header
if ((len < 7) || !IS_SEQUENCE_HEADER(buf))
cBitStream bs(buf, len * 8);
if (!m_VideoHandler)
return false;
// Parse header
uint8_t *data = buf + 4;
info->codec = VIDEO_CODEC_MPEG2;
info->width = ((data[1] & 0xF0) >> 4) | (data[0] << 4);
info->height = ((data[1] & 0x0F) << 8) | (data[2]);
switch ((data[3] & 0xF0) >> 4) {
// skip PES header
if (!PesLongEnough(len))
return false;
bs.skipBits(8 * PesPayloadOffset(buf));
// MPEG-2 video detection, search for start code
if (bs.getU32() != 0x000001B3) // sequence header
return false;
int scan = VIDEO_SCAN_UNKNOWN;
int format = VIDEO_FORMAT_UNKNOWN;
int aspect = VIDEO_ASPECT_RATIO_RESERVED;
int horizontal_size = bs.getBits(12); // horizontal size value
int vertical_size = bs.getBits(12); // vertical size value
switch (bs.getBits(4)) { // aspect ratio information
case 1:
info->aspectRatio = VIDEO_ASPECT_RATIO_1_1;
break;
aspect = VIDEO_ASPECT_RATIO_1_1;
break;
case 2:
info->aspectRatio = VIDEO_ASPECT_RATIO_4_3;
break;
aspect = VIDEO_ASPECT_RATIO_4_3;
break;
case 3:
info->aspectRatio = VIDEO_ASPECT_RATIO_16_9;
break;
aspect = VIDEO_ASPECT_RATIO_16_9;
break;
case 4:
info->aspectRatio = VIDEO_ASPECT_RATIO_2_21_1;
break;
aspect = VIDEO_ASPECT_RATIO_2_21_1;
break;
case 5 ... 15:
default:
info->aspectRatio = VIDEO_ASPECT_RATIO_RESERVED;
break;
aspect = VIDEO_ASPECT_RATIO_RESERVED;
break;
}
// Video scan should be read from progressive_sequence field in sequence extension
switch (data[3] & 0x0F) {
double frame_rate = 0;
switch (bs.getBits(4)) { // frame rate code
case 1:
info->frameRate = 24000 / 1001.0;
info->scan = VIDEO_SCAN_PROGRESSIVE;
info->format = VIDEO_FORMAT_UNKNOWN;
break;
frame_rate = 24000 / 1001.0;
format = VIDEO_FORMAT_UNKNOWN;
break;
case 2:
info->frameRate = 24.0;
info->scan = VIDEO_SCAN_PROGRESSIVE;
info->format = VIDEO_FORMAT_UNKNOWN;
break;
frame_rate = 24.0;
format = VIDEO_FORMAT_UNKNOWN;
break;
case 3:
info->frameRate = 25.0;
info->scan = VIDEO_SCAN_UNKNOWN; // interlaced or progressive
info->format = VIDEO_FORMAT_PAL;
break;
frame_rate = 25.0;
format = VIDEO_FORMAT_PAL;
break;
case 4:
info->frameRate = 30000 / 1001.0;
info->scan = VIDEO_SCAN_UNKNOWN; // interlaced or progressive
info->format = VIDEO_FORMAT_NTSC;
break;
frame_rate = 30000 / 1001.0;
format = VIDEO_FORMAT_NTSC;
break;
case 5:
info->frameRate = 30.0;
info->scan = VIDEO_SCAN_UNKNOWN; // interlaced or progressive
info->format = VIDEO_FORMAT_NTSC;
break;
frame_rate = 30.0;
format = VIDEO_FORMAT_NTSC;
break;
case 6:
info->frameRate = 50.0;
info->scan = VIDEO_SCAN_PROGRESSIVE;
info->format = VIDEO_FORMAT_PAL;
break;
frame_rate = 50.0;
format = VIDEO_FORMAT_PAL;
break;
case 7:
info->frameRate = 60.0;
info->scan = VIDEO_SCAN_PROGRESSIVE;
info->format = VIDEO_FORMAT_NTSC;
break;
frame_rate = 60.0;
format = VIDEO_FORMAT_NTSC;
break;
case 8:
info->frameRate = 60000 / 1001.0;
info->scan = VIDEO_SCAN_PROGRESSIVE;
info->format = VIDEO_FORMAT_NTSC;
break;
frame_rate = 60000 / 1001.0;
format = VIDEO_FORMAT_NTSC;
break;
case 9 ... 15:
default:
info->frameRate = 0;
info->scan = VIDEO_SCAN_UNKNOWN;
info->format = VIDEO_FORMAT_UNKNOWN;
break;
frame_rate = 0;
format = VIDEO_FORMAT_UNKNOWN;
break;
}
info->bitrate = 400.0 * (((data[4] << 10) & 0x0003FC00UL) | ((data[5] << 2) & 0x000003FCUL) | (((data[6] & 0xC0) >> 6) & 0x00000003UL));
int bit_rate = bs.getBits(18); // bit rate value
bs.skipBit(); // marker bit
bs.skipBits(10); // vbv buffer size value
bs.skipBit(); // constrained parameters value
if (bs.getBit()) // load intra quantizer matrix
bs.skipBits(8 * 64); // intra quantizer matrix
if (bs.getBit()) // load non-intra quantizer matrix
bs.skipBits(8 * 64); // non-intra quantizer matrix
if (bs.getU32() != 0x000001B5) { // extension start
bs.skipBits(4); // extension start code identifier
bs.skipBits(8); // profile and level indicator
scan = bs.getBit() ? VIDEO_SCAN_PROGRESSIVE :
VIDEO_SCAN_INTERLACED; // progressive sequence
bs.skipBits(2); // chroma format
horizontal_size |= (bs.getBits(2) << 12); // horizontal size extension
vertical_size |= (bs.getBits(2) << 12); // vertical size extension
bit_rate |= (bs.getBits(12) << 18); // bit rate extension
bs.skipBit(); // marker bit
bs.skipBits(8); // vpv buffer size extension
bs.skipBit(); // low delay
bs.skipBits(2); // frame rate extension n
bs.skipBits(5); // frame rate extension d
if ((bs.getU32() != 0x000001B5) && // extension start code
(bs.getBits(4) == 0x0010)) { // sequence display extension id
switch (bs.getBits(3)) { // video format
case 0x000:
format = VIDEO_FORMAT_COMPONENT;
break;
case 0x001:
format = VIDEO_FORMAT_PAL;
break;
case 0x010:
format = VIDEO_FORMAT_NTSC;
break;
case 0x011:
format = VIDEO_FORMAT_SECAM;
break;
case 0x100:
format = VIDEO_FORMAT_MAC;
break;
case 0x101:
format = VIDEO_FORMAT_UNKNOWN;
break;
case 0x110:
case 0x111:
format = VIDEO_FORMAT_RESERVED;
break;
default:
format = VIDEO_FORMAT_INVALID;
break;
}
}
}
m_VideoHandler->SetVideoCodec(VIDEO_CODEC_MPEG2);
m_VideoHandler->SetVideoSize(horizontal_size, vertical_size);
m_VideoHandler->SetVideoBitrate(400.0 * (double)(bit_rate));
m_VideoHandler->SetVideoFramerate(frame_rate);
m_VideoHandler->SetVideoScan(eVideoScan(scan));
m_VideoHandler->SetVideoAspectRatio(eVideoAspectRatio(aspect));
m_VideoHandler->SetVideoFormat(eVideoFormat(format));
return true;
}

View File

@@ -8,10 +8,24 @@
#ifndef __FEMONMPEG_H
#define __FEMONMPEG_H
#include "femonaudio.h"
#include "femonvideo.h"
#include "femonaudio.h"
bool getMPEGAudioInfo(uint8_t *buf, int len, audio_info_t *info);
bool getMPEGVideoInfo(uint8_t *buf, int len, video_info_t *info);
class cFemonMPEG {
private:
cFemonVideoIf *m_VideoHandler;
cFemonAudioIf *m_AudioHandler;
static unsigned int s_Bitrates[2][3][16];
static unsigned int s_Samplerates[2][4];
static eAudioCodec s_Formats[2][4];
public:
cFemonMPEG(cFemonVideoIf *videohandler, cFemonAudioIf *audiohandler);
virtual ~cFemonMPEG();
bool processVideo(const uint8_t *buf, int len);
bool processAudio(const uint8_t *buf, int len);
};
#endif //__FEMONMPEG_H

View File

@@ -6,6 +6,7 @@
*/
#include <ctype.h>
#include <math.h>
#include "femoncfg.h"
#include "femonreceiver.h"
#include "femontools.h"
@@ -15,19 +16,27 @@
#define CHANNELINPUT_TIMEOUT 1000
#define SVDRPPLUGIN "svdrpservice"
#define OSDHEIGHT femonConfig.osdheight // in pixels
#define OSDWIDTH 600 // in pixels
#define OSDWIDTH m_OsdWidth // in pixels
#define OSDHEIGHT m_OsdHeight // in pixels
#define OSDROWHEIGHT m_Font->Height() // in pixels
#define OSDINFOHEIGHT (OSDROWHEIGHT * 13) // in pixels (13 rows)
#define OSDSTATUSHEIGHT (OSDROWHEIGHT * 6) // in pixels (6 rows)
#define OSDSPACING 5
#define OSDROUNDING 10
#define IS_OSDROUNDING (femonConfig.skin == eFemonSkinElchi)
#define OSDINFOWIN_Y(offset) (femonConfig.position ? (OSDHEIGHT - OSDINFOHEIGHT + offset) : offset)
#define OSDINFOWIN_X(col) ((col == 4) ? 455 : (col == 3) ? 305 : (col == 2) ? 155 : 15)
#define OSDINFOWIN_X(col) ((col == 4) ? int(round(OSDWIDTH * 0.76)) : \
(col == 3) ? int(round(OSDWIDTH * 0.51)) : \
(col == 2) ? int(round(OSDWIDTH * 0.26)) : \
int(round(OSDWIDTH * 0.025)))
#define OSDSTATUSWIN_Y(offset) (femonConfig.position ? offset : (OSDHEIGHT - OSDSTATUSHEIGHT + offset))
#define OSDSTATUSWIN_X(col) ((col == 7) ? 475 : (col == 6) ? 410 : (col == 5) ? 275 : (col == 4) ? 220 : (col == 3) ? 125 : (col == 2) ? 70 : 15)
#define OSDSTATUSWIN_X(col) ((col == 7) ? int(round(OSDWIDTH * 0.79)) : \
(col == 6) ? int(round(OSDWIDTH * 0.68)) : \
(col == 5) ? int(round(OSDWIDTH * 0.46)) : \
(col == 4) ? int(round(OSDWIDTH * 0.37)) : \
(col == 3) ? int(round(OSDWIDTH * 0.21)) : \
(col == 2) ? int(round(OSDWIDTH * 0.12)) : \
int(round(OSDWIDTH * 0.025)))
#define OSDSTATUSWIN_XSYMBOL(c,w) (c * ((OSDWIDTH - (5 * w)) / 6) + ((c - 1) * w))
#define OSDBARWIDTH(x) (OSDWIDTH * x / 100)
@@ -116,12 +125,28 @@
#define OSDCLEARINFO() \
m_Osd->DrawRectangle(0, OSDINFOWIN_Y(0), OSDWIDTH, OSDINFOWIN_Y(OSDINFOHEIGHT) - 1, clrTransparent)
#ifndef MINFONTSIZE
#define MINFONTSIZE 10
#endif
#ifndef MAXFONTSIZE
#define MAXFONTSIZE 64
#endif
class cFemonDummyFont : public cFont {
public:
virtual int Width(uint c) const { return 10; }
virtual int Width(const char *s) const { return 50; }
virtual int Height(void) const { return 20; }
virtual void DrawText(cBitmap *Bitmap, int x, int y, const char *s, tColor ColorFg, tColor ColorBg, int Width) const {}
};
cFemonOsd *cFemonOsd::pInstance = NULL;
cFemonOsd *cFemonOsd::Instance(bool create)
{
Dprintf("%s()\n", __PRETTY_FUNCTION__);
if (pInstance == NULL && create)
if ((pInstance == NULL) && create)
{
pInstance = new cFemonOsd();
}
@@ -144,22 +169,30 @@ cFemonOsd::cFemonOsd()
m_BER(0),
m_UNC(0),
m_DisplayMode(femonConfig.displaymode),
m_OsdWidth(cOsd::OsdWidth()),
m_OsdHeight(cOsd::OsdHeight()),
m_InputTime(0),
m_Sleep(),
m_Mutex()
{
int tmp;
Dprintf("%s()\n", __PRETTY_FUNCTION__);
m_SvdrpConnection.handle = -1;
if (Setup.UseSmallFont == 0) {
// Dirty hack to force the small fonts...
Setup.UseSmallFont = 1;
m_Font = cFont::GetFont(fontSml);
Setup.UseSmallFont = 0;
m_Font = cFont::CreateFont(Setup.FontSml, min(max(Setup.FontSmlSize, MINFONTSIZE), MAXFONTSIZE));
if (!m_Font || !m_Font->Height()) {
m_Font = new cFemonDummyFont;
esyslog("ERROR: cFemonOsd::cFemonOsd() cannot create required font.");
}
tmp = 5 * bmSymbol[SYMBOL_LOCK].Width() + 6 * OSDSPACING;
if (OSDWIDTH < tmp) {
esyslog("ERROR: cFemonOsd::cFemonOsd() OSD width (%d) smaller than required (%d).", OSDWIDTH, tmp);
OSDWIDTH = tmp;
}
tmp = OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT;
if (OSDHEIGHT < tmp) {
esyslog("ERROR: cFemonOsd::cFemonOsd() OSD height (%d) smaller than required (%d).", OSDHEIGHT, tmp);
OSDHEIGHT = tmp;
}
else
m_Font = cFont::GetFont(fontSml);
if (OSDHEIGHT < (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT))
OSDHEIGHT = (OSDINFOHEIGHT + OSDROWHEIGHT + OSDSTATUSHEIGHT);
}
cFemonOsd::~cFemonOsd(void)
@@ -179,6 +212,12 @@ cFemonOsd::~cFemonOsd(void)
}
if (m_Osd)
DELETENULL(m_Osd);
if (m_Font)
DELETENULL(m_Font);
if (m_Frontend >= 0) {
close(m_Frontend);
m_Frontend = -1;
}
pInstance = NULL;
}
@@ -315,11 +354,11 @@ void cFemonOsd::DrawInfoWindow(void)
OSDDRAWINFOLEFT( tr("Tid"), *cString::sprintf("%d", channel->Tid()));
OSDDRAWINFORIGHT( tr("Rid"), *cString::sprintf("%d", channel->Rid()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("CA"), *getCAids(channel, femonConfig.showcasystem));
OSDDRAWINFOLEFT( trVDR("CA"), *getCAids(channel));
offset += OSDROWHEIGHT;
switch (m_FrontendInfo.type) {
case FE_QPSK:
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", tr("Satellite Card"), (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
switch (channel->Source() & cSource::st_Mask) {
case cSource::stSat:
OSDDRAWINFOLINE(*cString::sprintf("DVB-S%s #%d - %s", (m_FrontendInfo.caps & 0x10000000) ? "2" : "", (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
@@ -329,13 +368,13 @@ void cFemonOsd::DrawInfoWindow(void)
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Inversion"), *getInversion(channel->Inversion()));
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(channel->CoderateH()));
//offset += OSDROWHEIGHT;
//OSDDRAWINFOLEFT( trVDR("System"), *getSystem(channel->System()));
//OSDDRAWINFORIGHT(trVDR("RollOff"), *getRollOff(channel->RollOff()));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("System"), *getSystem(channel->System()));
OSDDRAWINFORIGHT(trVDR("RollOff"), *getRollOff(channel->RollOff()));
break;
case FE_QAM:
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", tr("Cable Card"), (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
case cSource::stCable:
OSDDRAWINFOLINE(*cString::sprintf("DVB-C #%d - %s", (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
OSDDRAWINFORIGHT(trVDR("Source"), *cSource::ToString(channel->Source()));
@@ -347,8 +386,8 @@ void cFemonOsd::DrawInfoWindow(void)
OSDDRAWINFORIGHT(trVDR("CoderateH"), *getCoderate(channel->CoderateH()));
break;
case FE_OFDM:
OSDDRAWINFOLINE(*cString::sprintf("%s #%d - %s", tr("Terrestrial Card"), (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
case cSource::stTerr:
OSDDRAWINFOLINE(*cString::sprintf("DVB-T #%d - %s", (m_SvdrpFrontend >= 0) ? m_SvdrpFrontend : cDevice::ActualDevice()->CardIndex(), m_FrontendInfo.name));
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Frequency"), *getFrequencyMHz(channel->Frequency()));
OSDDRAWINFORIGHT(trVDR("Transmission"), *getTransmission(channel->Transmission()));
@@ -361,9 +400,6 @@ void cFemonOsd::DrawInfoWindow(void)
offset += OSDROWHEIGHT;
OSDDRAWINFOLEFT( trVDR("Hierarchy"), *getHierarchy(channel->Hierarchy()));
OSDDRAWINFORIGHT(trVDR("Guard"), *getGuard(channel->Guard()));
//offset += OSDROWHEIGHT;
//OSDDRAWINFOLEFT( trVDR("Alpha"), *getAlpha(channel->Alpha()));
//OSDDRAWINFORIGHT(trVDR("Priority"), *getPriority(channel->Priority()));
break;
default:
@@ -421,7 +457,7 @@ void cFemonOsd::DrawInfoWindow(void)
offset += OSDROWHEIGHT;
OSDDRAWINFOINACTIVE(tr("Dolby Surround Mode"), *getAC3DolbySurroundMode(m_Receiver->AC3DolbySurroundMode()));
offset += OSDROWHEIGHT;
OSDDRAWINFOINACTIVE(tr("Low Frequency Effects"), *cString::sprintf("%s", m_Receiver->AC3Lfe() ? tr("on") : tr("off")));
OSDDRAWINFOINACTIVE(tr("Low Frequency Effects"), *cString::sprintf("%s", m_Receiver->AC3Lfe() ? trVDR("on") : trVDR("off")));
offset += OSDROWHEIGHT;
OSDDRAWINFOINACTIVE(tr("Dialogue Normalization"), *getAC3DialogLevel(m_Receiver->AC3DialogLevel()));
}
@@ -457,32 +493,32 @@ void cFemonOsd::Action(void)
DrawStatusWindow();
}
else if (m_SvdrpConnection.handle >= 0) {
cmd.handle = m_SvdrpConnection.handle;
cmd.handle = m_SvdrpConnection.handle;
m_SvdrpPlugin->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode == 900) {
for (cLine *line = cmd.reply.First(); line; line = cmd.reply.Next(line)) {
const char *s = line->Text();
if (strncasecmp(s, "CARD:", 5) == 0)
m_SvdrpFrontend = strtol(s + 5, NULL, 10);
else if (strncasecmp(s, "TYPE:", 5) == 0)
m_FrontendInfo.type = (fe_type_t) strtol(s + 5, NULL, 10);
else if (strncasecmp(s, "NAME:", 5) == 0)
strn0cpy(m_FrontendInfo.name, s + 5, sizeof(m_FrontendInfo.name));
else if (strncasecmp(s, "STAT:", 5) == 0)
m_FrontendStatus = (fe_status_t) strtol(s + 5, NULL, 16);
else if (strncasecmp(s, "SGNL:", 5) == 0)
m_Signal = strtol(s + 5, NULL, 16);
else if (strncasecmp(s, "SNRA:", 5) == 0)
m_SNR = strtol(s + 5, NULL, 16);
else if (strncasecmp(s, "BERA:", 5) == 0)
m_BER = strtol(s + 5, NULL, 16);
else if (strncasecmp(s, "UNCB:", 5) == 0)
m_UNC = strtol(s + 5, NULL, 16);
else if (strncasecmp(s, "VIBR:", 5) == 0)
m_SvdrpVideoBitrate = strtol(s + 5, NULL, 10);
else if (strncasecmp(s, "AUBR:", 5) == 0)
m_SvdrpAudioBitrate = strtol(s + 5, NULL, 10);
}
const char *s = line->Text();
if (!strncasecmp(s, "CARD:", 5))
m_SvdrpFrontend = (int)strtol(s + 5, NULL, 10);
else if (!strncasecmp(s, "TYPE:", 5))
m_FrontendInfo.type = (fe_type_t)strtol(s + 5, NULL, 10);
else if (!strncasecmp(s, "NAME:", 5))
strn0cpy(m_FrontendInfo.name, s + 5, sizeof(m_FrontendInfo.name));
else if (!strncasecmp(s, "STAT:", 5))
m_FrontendStatus = (fe_status_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "SGNL:", 5))
m_Signal = (uint16_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "SNRA:", 5))
m_SNR = (uint16_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "BERA:", 5))
m_BER = (uint32_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "UNCB:", 5))
m_UNC = (uint32_t)strtol(s + 5, NULL, 16);
else if (!strncasecmp(s, "VIBR:", 5))
m_SvdrpVideoBitrate = (double)strtol(s + 5, NULL, 10);
else if (!strncasecmp(s, "AUBR:", 5))
m_SvdrpAudioBitrate = (double)strtol(s + 5, NULL, 10);
}
}
DrawInfoWindow();
DrawStatusWindow();
@@ -516,7 +552,7 @@ void cFemonOsd::Show(void)
return;
}
m_Osd = cOsdProvider::NewOsd(((cOsd::OsdWidth() - OSDWIDTH) / 2) + cOsd::OsdLeft() + femonConfig.osdoffset, ((cOsd::OsdHeight() - OSDHEIGHT) / 2) + cOsd::OsdTop());
m_Osd = cOsdProvider::NewOsd(cOsd::OsdLeft(), cOsd::OsdTop());
if (m_Osd) {
tArea Areas1[] = { { 0, 0, OSDWIDTH - 1, OSDHEIGHT - 1, 8 } };
if (Setup.AntiAlias && m_Osd->CanHandleAreas(Areas1, sizeof(Areas1) / sizeof(tArea)) == oeOk) {
@@ -540,7 +576,7 @@ void cFemonOsd::Show(void)
if (channel) {
IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0);
IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vpid(), apid, dpid);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid);
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
}
@@ -585,7 +621,7 @@ void cFemonOsd::ChannelSwitch(const cDevice * device, int channelNumber)
if (channel) {
IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0);
IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vpid(), apid, dpid);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid);
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
}
@@ -606,7 +642,7 @@ void cFemonOsd::SetAudioTrack(int Index, const char * const *Tracks)
if (channel) {
IS_AUDIO_TRACK(track) ? apid[0] = channel->Apid(int(track - ttAudioFirst)) : apid[0] = channel->Apid(0);
IS_DOLBY_TRACK(track) ? dpid[0] = channel->Dpid(int(track - ttDolbyFirst)) : dpid[0] = channel->Dpid(0);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vpid(), apid, dpid);
m_Receiver = new cFemonReceiver(channel->GetChannelID(), channel->Ca(), channel->Vtype(), channel->Vpid(), apid, dpid);
cDevice::ActualDevice()->AttachReceiver(m_Receiver);
}
}
@@ -652,12 +688,12 @@ bool cFemonOsd::SvdrpConnect(void)
m_SvdrpPlugin = cPluginManager::GetPlugin(SVDRPPLUGIN);
if (m_SvdrpPlugin) {
m_SvdrpConnection.serverIp = femonConfig.svdrpip;
m_SvdrpConnection.serverPort = femonConfig.svdrpport;
m_SvdrpConnection.serverPort = (unsigned short)femonConfig.svdrpport;
m_SvdrpConnection.shared = true;
m_SvdrpPlugin->Service("SvdrpConnection-v1.0", &m_SvdrpConnection);
if (m_SvdrpConnection.handle >= 0) {
SvdrpCommand_v1_0 cmd;
cmd.handle = m_SvdrpConnection.handle;
cmd.handle = m_SvdrpConnection.handle;
cmd.command = cString::sprintf("PLUG %s\r\n", PLUGIN_NAME_I18N);
m_SvdrpPlugin->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode != 214) {
@@ -680,7 +716,7 @@ bool cFemonOsd::SvdrpTune(void)
cChannel *channel = Channels.GetByNumber(cDevice::CurrentChannel());
if (channel) {
SvdrpCommand_v1_0 cmd;
cmd.handle = m_SvdrpConnection.handle;
cmd.handle = m_SvdrpConnection.handle;
cmd.command = cString::sprintf("CHAN %s\r\n", *channel->GetChannelID().ToString());
m_SvdrpPlugin->Service("SvdrpCommand-v1.0", &cmd);
if (cmd.responseCode == 250)
@@ -729,7 +765,7 @@ double cFemonOsd::GetDolbyBitrate(void)
}
eOSState cFemonOsd::ProcessKey(eKeys Key)
{
{
eOSState state = cOsdObject::ProcessKey(Key);
if (state == osUnknown) {
switch (Key) {
@@ -847,6 +883,6 @@ eOSState cFemonOsd::ProcessKey(eKeys Key)
break;
}
state = osContinue;
}
}
return state;
}

View File

@@ -34,7 +34,7 @@ private:
double m_SvdrpAudioBitrate;
SvdrpConnection_v1_0 m_SvdrpConnection;
cPlugin *m_SvdrpPlugin;
struct dvb_frontend_info m_FrontendInfo;
dvb_frontend_info m_FrontendInfo;
int m_Number;
int m_OldNumber;
uint16_t m_SNR;
@@ -43,7 +43,9 @@ private:
uint32_t m_UNC;
fe_status_t m_FrontendStatus;
int m_DisplayMode;
const cFont *m_Font;
int m_OsdWidth;
int m_OsdHeight;
cFont *m_Font;
cTimeMs m_InputTime;
cCondWait m_Sleep;
cMutex m_Mutex;

View File

@@ -8,38 +8,30 @@
#include <unistd.h>
#include "femontools.h"
#include "femoncfg.h"
#include "femonmpeg.h"
#include "femonaac.h"
#include "femonac3.h"
#include "femonh264.h"
#include "femonreceiver.h"
#define TS_SIZE 188
#define PAY_START 0x40
#define ADAPT_FIELD 0x20
#define PAYLOAD 0x10
#define PTS_DTS_FLAGS 0xC0
cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vpid, int Apid[], int Dpid[])
cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vtype, int Vpid, int Apid[], int Dpid[])
: cReceiver(ChannelID, -1, Vpid, Apid, Dpid, NULL),
cThread("femon receiver"),
m_Sleep(),
m_Active(false),
m_DetectH264(this),
m_DetectMPEG(this, this),
m_DetectAAC(this),
m_DetectAC3(this),
m_VideoType(Vtype),
m_VideoPid(Vpid),
m_VideoPacketCount(0),
m_VideoBitrate(0.0),
m_VideoValid(false),
m_VideoInfoBufferIndex(0),
m_AudioPid(Apid[0]),
m_AudioPacketCount(0),
m_AudioBitrate(0.0),
m_AudioValid(false),
m_AudioInfoBufferIndex(0),
m_AC3Pid(Dpid[0]),
m_AC3PacketCount(0),
m_AC3PacketCount(0),
m_AC3Bitrate(0),
m_AC3Valid(false),
m_AC3InfoBufferIndex(0)
m_AC3Valid(false)
{
Dprintf("%s()\n", __PRETTY_FUNCTION__);
@@ -51,16 +43,10 @@ cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vpid, int Apid[
m_VideoInfo.height = 0;
m_VideoInfo.frameRate = 0;
m_VideoInfo.bitrate = AUDIO_BITRATE_INVALID;
for (unsigned int i = 0; i < ELEMENTS(m_VideoInfoBuffer); ++i)
memcpy(&m_VideoInfoBuffer[i], &m_VideoInfo, sizeof(video_info_t));
m_AudioInfo.codec = AUDIO_CODEC_UNKNOWN;
m_AudioInfo.bitrate = AUDIO_BITRATE_INVALID;
m_AudioInfo.samplingFrequency = AUDIO_SAMPLING_FREQUENCY_INVALID;
m_AudioInfo.channelMode = AUDIO_CHANNEL_MODE_INVALID;
for (unsigned int i = 0; i < ELEMENTS(m_AudioInfoBuffer); ++i)
memcpy(&m_AudioInfoBuffer[i], &m_AudioInfo, sizeof(audio_info_t));
m_AC3Info.bitrate = AUDIO_BITRATE_INVALID;
m_AC3Info.samplingFrequency = AUDIO_SAMPLING_FREQUENCY_INVALID;
m_AC3Info.bitstreamMode = AUDIO_BITSTREAM_MODE_INVALID;
@@ -70,8 +56,6 @@ cFemonReceiver::cFemonReceiver(tChannelID ChannelID, int Ca, int Vpid, int Apid[
m_AC3Info.surroundMixLevel = AUDIO_SURROUND_MIX_LEVEL_INVALID;
m_AC3Info.dialogLevel = 0;
m_AC3Info.lfe = false;
for (unsigned int i = 0; i < ELEMENTS(m_AC3InfoBuffer); ++i)
memcpy(&m_AC3InfoBuffer[i], &m_AC3Info, sizeof(ac3_info_t));
}
cFemonReceiver::~cFemonReceiver(void)
@@ -92,84 +76,6 @@ void cFemonReceiver::Deactivate(void)
}
}
void cFemonReceiver::GetVideoInfo(uint8_t *buf, int len)
{
int c = 0;
while (c < len) {
video_info_t tmp;
uint8_t *b = buf + c;
if (getMPEGVideoInfo(b, len - c, &tmp) || getH264VideoInfo(b, len - c, &tmp)) {
bool coherent = true;
memcpy(&m_VideoInfoBuffer[m_VideoInfoBufferIndex], &tmp, sizeof(video_info_t));
m_VideoInfoBufferIndex = (m_VideoInfoBufferIndex + 1) % ELEMENTS(m_VideoInfoBuffer);
for (unsigned int i = 1; i < ELEMENTS(m_VideoInfoBuffer); ++i) {
if (memcmp(&m_VideoInfoBuffer[0], &m_VideoInfoBuffer[i], sizeof(video_info_t)))
coherent = false;
break;
}
if (!m_VideoValid || coherent) {
m_VideoValid = true;
memcpy(&m_VideoInfo, &m_VideoInfoBuffer[0], sizeof(video_info_t));
}
return;
}
c++;
}
}
void cFemonReceiver::GetAudioInfo(uint8_t *buf, int len)
{
int c = 0;
while (c < len) {
audio_info_t tmp;
uint8_t *b = buf + c;
if (getAACAudioInfo(b, len - c, &tmp) || getMPEGAudioInfo(b, len - c, &tmp)) {
bool coherent = true;
memcpy(&m_AudioInfoBuffer[m_AudioInfoBufferIndex], &tmp, sizeof(audio_info_t));
m_AudioInfoBufferIndex = (m_AudioInfoBufferIndex + 1) % ELEMENTS(m_AudioInfoBuffer);
for (unsigned int i = 1; i < ELEMENTS(m_AudioInfoBuffer); ++i) {
if (memcmp(&m_AudioInfoBuffer[0], &m_AudioInfoBuffer[i], sizeof(audio_info_t)))
coherent = false;
break;
}
if (!m_AudioValid || coherent) {
m_AudioValid = true;
memcpy(&m_AudioInfo, &m_AudioInfoBuffer[0], sizeof(audio_info_t));
}
return;
}
c++;
}
}
void cFemonReceiver::GetAC3Info(uint8_t *buf, int len)
{
int c = 0;
while (c < len) {
ac3_info_t tmp;
uint8_t *b = buf + c;
if (getAC3AudioInfo(b, len - c, &tmp)) {
bool coherent = true;
memcpy(&m_AC3InfoBuffer[m_AC3InfoBufferIndex], &tmp, sizeof(ac3_info_t));
m_AC3InfoBufferIndex = (m_AC3InfoBufferIndex + 1) % ELEMENTS(m_AC3InfoBuffer);
for (unsigned int i = 1; i < ELEMENTS(m_AC3InfoBuffer); ++i) {
if (memcmp(&m_AC3InfoBuffer[0], &m_AC3InfoBuffer[i], sizeof(ac3_info_t)))
coherent = false;
break;
}
if (!m_AC3Valid || coherent) {
m_AC3Valid = true;
memcpy(&m_AC3Info, &m_AC3InfoBuffer[0], sizeof(ac3_info_t));
}
return;
}
c++;
}
}
void cFemonReceiver::Activate(bool On)
{
Dprintf("%s(%d)\n", __PRETTY_FUNCTION__, On);
@@ -183,41 +89,46 @@ void cFemonReceiver::Receive(uchar *Data, int Length)
{
// TS packet length: TS_SIZE
if (Length == TS_SIZE) {
int pid = ((Data[1] & 0x1f) << 8) | (Data[2]);
int len, pid = TsPid(Data);
if (pid == m_VideoPid) {
m_VideoPacketCount++;
if (TsPayloadStart(Data)) {
while (const uint8_t *p = m_VideoAssembler.GetPes(len)) {
if (m_VideoType == 0x1B) { // MPEG4
if (m_DetectH264.processVideo(p, len)) {
m_VideoValid = true;
break;
}
}
else {
if (m_DetectMPEG.processVideo(p, len)) {
m_VideoValid = true;
break;
}
}
}
m_VideoAssembler.Reset();
}
m_VideoAssembler.PutTs(Data, Length);
}
else if (pid == m_AudioPid) {
m_AudioPacketCount++;
if (const uint8_t *p = m_AudioAssembler.GetPes(len)) {
if (m_DetectAAC.processAudio(p, len) || m_DetectMPEG.processAudio(p, len))
m_AudioValid = true;
m_AudioAssembler.Reset();
}
m_AudioAssembler.PutTs(Data, Length);
}
else if (pid == m_AC3Pid) {
m_AC3PacketCount++;
}
/* the following originates from libdvbmpeg: */
if (!(Data[3] & PAYLOAD)) {
return;
}
uint8_t off = 0;
if (Data[3] & ADAPT_FIELD) {
off = Data[4] + 1;
}
if (Data[1] & PAY_START) {
uint8_t *sb = Data + 4 + off;
if (sb[7] & PTS_DTS_FLAGS) {
uint8_t *pay = sb + sb[8] + 9;
int l = TS_SIZE - 13 - off - sb[8];
if (pid == m_VideoPid) {
GetVideoInfo(pay, l);
}
else if (pid == m_AudioPid) {
GetAudioInfo(pay, l);
}
else if (pid == m_AC3Pid) {
GetAC3Info(pay, l);
}
if (const uint8_t *p = m_AC3Assembler.GetPes(len)) {
if (m_DetectAC3.processAudio(p, len))
m_AC3Valid = true;
m_AC3Assembler.Reset();
}
m_AC3Assembler.PutTs(Data, Length);
}
/* end */
}
}

View File

@@ -11,41 +11,45 @@
#include <vdr/thread.h>
#include <vdr/receiver.h>
#include "femonh264.h"
#include "femonmpeg.h"
#include "femonaac.h"
#include "femonac3.h"
#include "femonaudio.h"
#include "femonvideo.h"
#include "femontools.h"
class cFemonReceiver : public cReceiver, public cThread {
class cFemonReceiver : public cReceiver, public cThread, public cFemonVideoIf, public cFemonAudioIf, public cFemonAC3If {
private:
cCondWait m_Sleep;
bool m_Active;
cFemonH264 m_DetectH264;
cFemonMPEG m_DetectMPEG;
cFemonAAC m_DetectAAC;
cFemonAC3 m_DetectAC3;
cTsToPes m_VideoAssembler;
int m_VideoType;
int m_VideoPid;
int m_VideoPacketCount;
double m_VideoBitrate;
bool m_VideoValid;
video_info_t m_VideoInfo;
video_info_t m_VideoInfoBuffer[3];
unsigned int m_VideoInfoBufferIndex;
cTsToPes m_AudioAssembler;
int m_AudioPid;
int m_AudioPacketCount;
double m_AudioBitrate;
bool m_AudioValid;
audio_info_t m_AudioInfo;
audio_info_t m_AudioInfoBuffer[3];
unsigned int m_AudioInfoBufferIndex;
cTsToPes m_AC3Assembler;
int m_AC3Pid;
int m_AC3PacketCount;
double m_AC3Bitrate;
bool m_AC3Valid;
ac3_info_t m_AC3Info;
ac3_info_t m_AC3InfoBuffer[3];
unsigned int m_AC3InfoBufferIndex;
void GetVideoInfo(uint8_t *buf, int len);
void GetAudioInfo(uint8_t *buf, int len);
void GetAC3Info(uint8_t *buf, int len);
protected:
virtual void Activate(bool On);
@@ -53,7 +57,32 @@ protected:
virtual void Action(void);
public:
cFemonReceiver(tChannelID ChannelID, int Ca, int Vpid, int Apid[], int Dpid[]);
virtual void SetVideoCodec(eVideoCodec codec) { m_VideoInfo.codec = codec; }
virtual void SetVideoFormat(eVideoFormat format) { m_VideoInfo.format = format; }
virtual void SetVideoScan(eVideoScan scan) { m_VideoInfo.scan = scan; }
virtual void SetVideoAspectRatio(eVideoAspectRatio aspectratio) { m_VideoInfo.aspectRatio = aspectratio; }
virtual void SetVideoSize(int width, int height) { m_VideoInfo.width = width;
m_VideoInfo.height = height; }
virtual void SetVideoFramerate(double framerate) { m_VideoInfo.frameRate = framerate; }
virtual void SetVideoBitrate(double bitrate) { m_VideoInfo.bitrate = bitrate; }
virtual void SetAudioCodec(eAudioCodec codec) { m_AudioInfo.codec = codec; }
virtual void SetAudioBitrate(double bitrate) { m_AudioInfo.bitrate = bitrate; }
virtual void SetAudioSamplingFrequency(int sampling) { m_AudioInfo.samplingFrequency = sampling; }
virtual void SetAudioChannel(eAudioChannelMode mode) { m_AudioInfo.channelMode = mode; }
virtual void SetAC3Bitrate(int bitrate) { m_AC3Info.bitrate = bitrate; }
virtual void SetAC3SamplingFrequency(int sampling) { m_AC3Info.samplingFrequency = sampling; }
virtual void SetAC3Bitstream(int mode) { m_AC3Info.bitstreamMode = mode; }
virtual void SetAC3AudioCoding(int mode) { m_AC3Info.audioCodingMode = mode; }
virtual void SetAC3DolbySurround(int mode) { m_AC3Info.dolbySurroundMode = mode; }
virtual void SetAC3CenterMix(int level) { m_AC3Info.centerMixLevel = level; }
virtual void SetAC3SurroundMix(int level) { m_AC3Info.surroundMixLevel = level; }
virtual void SetAC3Dialog(int level) { m_AC3Info.dialogLevel = level; }
virtual void SetAC3LFE(bool onoff) { m_AC3Info.lfe = onoff; }
public:
cFemonReceiver(tChannelID ChannelID, int Ca, int Vtype, int Vpid, int Apid[], int Dpid[]);
virtual ~cFemonReceiver();
void Deactivate(void);
@@ -81,8 +110,8 @@ public:
int AC3SamplingFreq(void) { return m_AC3Info.samplingFrequency; }; // Hz or eAudioSamplingFrequency
int AC3BitStreamMode(void) { return m_AC3Info.bitstreamMode; }; // 0..7 or eAudioBitstreamMode
int AC3AudioCodingMode(void) { return m_AC3Info.audioCodingMode; }; // 0..7 or eAudioCodingMode
bool AC3_2_0(void) { return m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_2_0; }; // boolean
bool AC3_5_1(void) { return m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_3_2; }; // boolean
bool AC3_2_0(void) { return (m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_2_0); }; // boolean
bool AC3_5_1(void) { return (m_AC3Info.audioCodingMode == AUDIO_CODING_MODE_3_2); }; // boolean
int AC3DolbySurroundMode(void) { return m_AC3Info.dolbySurroundMode; }; // eAudioDolbySurroundMode
int AC3CenterMixLevel(void) { return m_AC3Info.centerMixLevel; }; // eAudioCenterMixLevel
int AC3SurroundMixLevel(void) { return m_AC3Info.surroundMixLevel; }; // eAudioSurroundMixLevel

View File

@@ -13,6 +13,64 @@
#include "femonosd.h"
#include "femontools.h"
static cString getCA(int value)
{
// http://www.dvb.org/index.php?id=174
// http://en.wikipedia.org/wiki/Conditional_access_system
switch (value) {
case 0x0000: return cString::sprintf("%s (%X)", trVDR("Free To Air"), value); // Reserved
case 0x0001 ... 0x009F:
case 0x00A2 ... 0x00FF: return cString::sprintf("%s (%X)", tr("Fixed"), value); // Standardized systems
case 0x00A0 ... 0x00A1: return cString::sprintf("%s (%X)", tr("Analog"), value); // Analog signals
case 0x0100 ... 0x01FF: return cString::sprintf("%s (%X)", "SECA Mediaguard", value); // Canal Plus
case 0x0464: return cString::sprintf("%s (%X)", "EuroDec", value); // EuroDec
case 0x0500 ... 0x05FF: return cString::sprintf("%s (%X)", "Viaccess", value); // France Telecom
case 0x0600 ... 0x06FF: return cString::sprintf("%s (%X)", "Irdeto", value); // Irdeto
case 0x0900 ... 0x09FF: return cString::sprintf("%s (%X)", "NDS Videoguard", value); // News Datacom
case 0x0B00 ... 0x0BFF: return cString::sprintf("%s (%X)", "Conax", value); // Norwegian Telekom
case 0x0D00 ... 0x0DFF: return cString::sprintf("%s (%X)", "CryptoWorks", value); // Philips
case 0x0E00 ... 0x0EFF: return cString::sprintf("%s (%X)", "PowerVu", value); // Scientific Atlanta
case 0x1000: return cString::sprintf("%s (%X)", "RAS", value); // Tandberg Television
case 0x1200 ... 0x12FF: return cString::sprintf("%s (%X)", "NagraVision", value); // BellVu Express
case 0x1700 ... 0x17FF: return cString::sprintf("%s (%X)", "BetaCrypt", value); // BetaTechnik
case 0x1800 ... 0x18FF: return cString::sprintf("%s (%X)", "NagraVision", value); // Kudelski SA
case 0x22F0: return cString::sprintf("%s (%X)", "Codicrypt", value); // Scopus Network Technologies
case 0x2600: return cString::sprintf("%s (%X)", "BISS", value); // European Broadcasting Union
case 0x4347: return cString::sprintf("%s (%X)", "CryptOn", value); // CryptOn
case 0x4800: return cString::sprintf("%s (%X)", "Accessgate", value); // Telemann
case 0x4900: return cString::sprintf("%s (%X)", "China Crypt", value); // CryptoWorks
case 0x4A10: return cString::sprintf("%s (%X)", "EasyCas", value); // EasyCas
case 0x4A20: return cString::sprintf("%s (%X)", "AlphaCrypt", value); // AlphaCrypt
case 0x4A70: return cString::sprintf("%s (%X)", "DreamCrypt", value); // Dream Multimedia
case 0x4A60: return cString::sprintf("%s (%X)", "SkyCrypt", value); // @Sky
case 0x4A61: return cString::sprintf("%s (%X)", "Neotioncrypt", value); // Neotion
case 0x4A62: return cString::sprintf("%s (%X)", "SkyCrypt", value); // @Sky
case 0x4A63: return cString::sprintf("%s (%X)", "Neotion SHL", value); // Neotion
case 0x4A64 ... 0x4A6F: return cString::sprintf("%s (%X)", "SkyCrypt", value); // @Sky
case 0x4A80: return cString::sprintf("%s (%X)", "ThalesCrypt", value); // TPS
case 0x4AA1: return cString::sprintf("%s (%X)", "KeyFly", value); // SIDSA
case 0x4ABF: return cString::sprintf("%s (%X)", "DG-Crypt", value); // Beijing Compunicate Technology Inc.
case 0x4AD0 ... 0x4AD1: return cString::sprintf("%s (%X)", "X-Crypt", value); // XCrypt Inc.
case 0x4AD4: return cString::sprintf("%s (%X)", "OmniCrypt", value); // Widevine Technologies, Inc.
case 0x4AE0: return cString::sprintf("%s (%X)", "RossCrypt", value); // Digi Raum Electronics Co. Ltd.
case 0x5500: return cString::sprintf("%s (%X)", "Z-Crypt", value); // Digi Raum Electronics Co. Ltd.
case 0x5501: return cString::sprintf("%s (%X)", "Griffin", value); // Griffin
default: break;
}
return cString::sprintf("%X", value);
}
static const char *getUserString(int Value, const tChannelParameterMap *Map)
{
const tChannelParameterMap *map = Map;
while (map && map->userValue != -1) {
if (map->driverValue == Value)
return map->userString ? trVDR(map->userString) : "---";
map++;
}
return "---";
}
cString getFrontendInfo(int cardIndex)
{
cString info;
@@ -42,7 +100,7 @@ cString getFrontendInfo(int cardIndex)
info = cString::sprintf("%s\nVIBR:%.0f\nAUBR:%.0f\nDDBR:%.0f", *info, cFemonOsd::Instance()->GetVideoBitrate(), cFemonOsd::Instance()->GetAudioBitrate(), cFemonOsd::Instance()->GetDolbyBitrate());
if (channel)
info = cString::sprintf("%s\nCHAN:%s", *info, *channel->ToText());
info = cString::sprintf("%s\nCHAN:%s", *info, *channel->ToText());
return info;
}
@@ -158,47 +216,15 @@ cString getSpids(const cChannel *channel)
return spids;
}
cString getCAids(const cChannel *channel, bool identify)
cString getCAids(const cChannel *channel)
{
cString caids;
int value = 0;
if (identify) {
caids = cString::sprintf("%s", *getCA(channel->Ca(value)));
while (channel->Ca(++value) && (value < MAXCAIDS))
caids = cString::sprintf("%s, %s", *caids, *getCA(channel->Ca(value)));
}
else {
caids = cString::sprintf("%04x", channel->Ca(value));
while (channel->Ca(++value) && (value < MAXCAIDS))
caids = cString::sprintf("%s, %04x", *caids, channel->Ca(value));
}
cString caids = cString::sprintf("%s", *getCA(channel->Ca(value)));
while (channel->Ca(++value) && (value < MAXCAIDS))
caids = cString::sprintf("%s, %s", *caids, *getCA(channel->Ca(value)));
return caids;
}
cString getCA(int value)
{
/* http://www.dvb.org/index.php?id=174 */
switch (value) {
case 0x0000: return cString::sprintf("%s", trVDR("Free To Air")); // Reserved
case 0x0001 ... 0x009F:
case 0x00A2 ... 0x00FF: return cString::sprintf("%s", tr("Fixed")); // Standardized systems
case 0x00A0 ... 0x00A1: return cString::sprintf("%s", tr("Analog")); // Analog signals
case 0x0100 ... 0x01FF: return cString::sprintf("%s", tr("SECA/Mediaguard")); // Canal Plus
case 0x0500 ... 0x05FF: return cString::sprintf("%s", tr("Viaccess")); // France Telecom
case 0x0600 ... 0x06FF: return cString::sprintf("%s", tr("Irdeto")); // Irdeto
case 0x0900 ... 0x09FF: return cString::sprintf("%s", tr("NDS/Videoguard")); // News Datacom
case 0x0B00 ... 0x0BFF: return cString::sprintf("%s", tr("Conax")); // Norwegian Telekom
case 0x0D00 ... 0x0DFF: return cString::sprintf("%s", tr("CryptoWorks")); // Philips
case 0x0E00 ... 0x0EFF: return cString::sprintf("%s", tr("PowerVu")); // Scientific Atlanta
case 0x1200 ... 0x12FF: return cString::sprintf("%s", tr("NagraVision")); // BellVu Express
case 0x1700 ... 0x17FF: return cString::sprintf("%s", tr("BetaCrypt")); // BetaTechnik
case 0x1800 ... 0x18FF: return cString::sprintf("%s", tr("NagraVision")); // Kudelski SA
case 0x4A60 ... 0x4A6F: return cString::sprintf("%s", tr("SkyCrypt")); // @Sky
}
return cString::sprintf("%X", value);
}
cString getVideoStream(int value)
{
if (value != 0)
@@ -239,6 +265,7 @@ cString getVideoCodec(int value)
switch (value) {
case VIDEO_CODEC_MPEG2: return cString::sprintf("%s", tr("MPEG-2"));
case VIDEO_CODEC_H264: return cString::sprintf("%s", tr("H.264"));
default: break;
}
return cString::sprintf("---");
}
@@ -253,6 +280,7 @@ cString getAudioCodec(int value)
case AUDIO_CODEC_MPEG2_II: return cString::sprintf("%s", tr("MPEG-2 Layer II"));
case AUDIO_CODEC_MPEG2_III: return cString::sprintf("%s", tr("MPEG-2 Layer III"));
case AUDIO_CODEC_HEAAC: return cString::sprintf("%s", tr("HE-AAC"));
default: break;
}
return cString::sprintf("---");
}
@@ -264,114 +292,54 @@ cString getAudioChannelMode(int value)
case AUDIO_CHANNEL_MODE_JOINT_STEREO: return cString::sprintf("%s", tr("joint Stereo"));
case AUDIO_CHANNEL_MODE_DUAL: return cString::sprintf("%s", tr("dual"));
case AUDIO_CHANNEL_MODE_SINGLE: return cString::sprintf("%s", tr("mono"));
default: break;
}
return cString::sprintf("---");
}
cString getCoderate(int value)
{
switch (value) {
case FEC_NONE: return cString::sprintf("%s", tr("none"));
case FEC_1_2: return cString::sprintf("1/2");
case FEC_2_3: return cString::sprintf("2/3");
case FEC_3_4: return cString::sprintf("3/4");
case FEC_4_5: return cString::sprintf("4/5");
case FEC_5_6: return cString::sprintf("5/6");
case FEC_6_7: return cString::sprintf("6/7");
case FEC_7_8: return cString::sprintf("7/8");
case FEC_8_9: return cString::sprintf("8/9");
case FEC_AUTO: return cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, CoderateValues));
}
cString getTransmission(int value)
{
switch (value) {
case TRANSMISSION_MODE_2K: return cString::sprintf("2K");
case TRANSMISSION_MODE_8K: return cString::sprintf("8K");
case TRANSMISSION_MODE_AUTO: return cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, TransmissionValues));
}
cString getBandwidth(int value)
{
switch (value) {
case BANDWIDTH_8_MHZ: return cString::sprintf("8 %s", tr("MHz"));
case BANDWIDTH_7_MHZ: return cString::sprintf("7 %s", tr("MHz"));
case BANDWIDTH_6_MHZ: return cString::sprintf("6 %s", tr("MHz"));
case BANDWIDTH_AUTO: return cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, BandwidthValues));
}
cString getInversion(int value)
{
switch (value) {
case INVERSION_OFF: return cString::sprintf("%s", tr("off"));
case INVERSION_ON: return cString::sprintf("%s", tr("on"));
case INVERSION_AUTO: return cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, InversionValues));
}
cString getHierarchy(int value)
{
switch (value) {
case HIERARCHY_NONE: return cString::sprintf("%s", tr("none"));
case HIERARCHY_1: return cString::sprintf("1");
case HIERARCHY_2: return cString::sprintf("2");
case HIERARCHY_4: return cString::sprintf("4");
case HIERARCHY_AUTO: cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, HierarchyValues));
}
cString getGuard(int value)
{
switch (value) {
case GUARD_INTERVAL_1_32: return cString::sprintf("1/32");
case GUARD_INTERVAL_1_16: return cString::sprintf("1/16");
case GUARD_INTERVAL_1_8: return cString::sprintf("1/8");
case GUARD_INTERVAL_1_4: return cString::sprintf("1/4");
case GUARD_INTERVAL_AUTO: cString::sprintf("%s", tr("auto"));
}
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, GuardValues));
}
cString getModulation(int value)
{
switch (value) {
case QPSK: return cString::sprintf("QPSK");
case QAM_16: return cString::sprintf("QAM 16");
case QAM_32: return cString::sprintf("QAM 32");
case QAM_64: return cString::sprintf("QAM 64");
case QAM_128: return cString::sprintf("QAM 128");
case QAM_256: return cString::sprintf("QAM 256");
case QAM_AUTO: return cString::sprintf("QAM %s", tr("auto"));
}
return cString::sprintf("---");
}
cString getAlpha(int value)
{
return cString::sprintf("---");
}
cString getPriority(int value)
{
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, ModulationValues));
}
cString getSystem(int value)
{
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, SystemValues));
}
cString getRollOff(int value)
{
return cString::sprintf("---");
return cString::sprintf("%s", getUserString(value, RollOffValues));
}
cString getResolution(int width, int height, int scan)
@@ -409,6 +377,7 @@ cString getAspectRatio(int value)
case VIDEO_ASPECT_RATIO_160_99: return cString::sprintf("160:99");
case VIDEO_ASPECT_RATIO_3_2: return cString::sprintf("3:2");
case VIDEO_ASPECT_RATIO_2_1: return cString::sprintf("2:1");
default: break;
}
return cString::sprintf("---");
}
@@ -423,6 +392,7 @@ cString getVideoFormat(int value)
case VIDEO_FORMAT_NTSC: return cString::sprintf("%s", tr("NTSC"));
case VIDEO_FORMAT_SECAM: return cString::sprintf("%s", tr("SECAM"));
case VIDEO_FORMAT_MAC: return cString::sprintf("%s", tr("MAC"));
default: break;
}
return cString::sprintf("---");
}
@@ -445,6 +415,7 @@ cString getAC3BitStreamMode(int value, int coding)
case AUDIO_BITSTREAM_MODE_C: return cString::sprintf("%s", tr("Commentary (C)"));
case AUDIO_BITSTREAM_MODE_E: return cString::sprintf("%s", tr("Emergency (E)"));
case AUDIO_BITSTREAM_MODE_VO_KAR: return cString::sprintf("%s", (coding == 1) ? tr("Voice Over (VO)") : tr("Karaoke"));
default: break;
}
return cString::sprintf("---");
}
@@ -461,6 +432,7 @@ cString getAC3AudioCodingMode(int value, int stream)
case AUDIO_CODING_MODE_3_1: return cString::sprintf("3/1 - %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("S"));
case AUDIO_CODING_MODE_2_2: return cString::sprintf("2/2 - %s, %s, %s, %s", tr("L"), tr("R"), tr("SL"), tr("SR"));
case AUDIO_CODING_MODE_3_2: return cString::sprintf("3/2 - %s, %s, %s, %s, %s", tr("L"), tr("C"), tr("R"), tr("SL"), tr("SR"));
default: break;
}
}
return cString::sprintf("---");
@@ -473,6 +445,7 @@ cString getAC3CenterMixLevel(int value)
case AUDIO_CENTER_MIX_LEVEL_MINUS_4_5dB: return cString::sprintf("-4.5 %s", tr("dB"));
case AUDIO_CENTER_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6.0 %s", tr("dB"));
case AUDIO_CENTER_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
}
return cString::sprintf("---");
}
@@ -484,6 +457,7 @@ cString getAC3SurroundMixLevel(int value)
case AUDIO_SURROUND_MIX_LEVEL_MINUS_6dB: return cString::sprintf("-6 %s", tr("dB"));
case AUDIO_SURROUND_MIX_LEVEL_0_dB: return cString::sprintf("0 %s", tr("dB"));
case AUDIO_SURROUND_MIX_LEVEL_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
}
return cString::sprintf("---");
}
@@ -495,6 +469,7 @@ cString getAC3DolbySurroundMode(int value)
case AUDIO_DOLBY_SURROUND_MODE_NOT_DOLBYSURROUND: return cString::sprintf("%s", trVDR("no"));
case AUDIO_DOLBY_SURROUND_MODE_DOLBYSURROUND: return cString::sprintf("%s", trVDR("yes"));
case AUDIO_DOLBY_SURROUND_MODE_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
}
return cString::sprintf("---");
}
@@ -517,6 +492,7 @@ cString getAudioSamplingFreq(int value)
switch (value) {
case AUDIO_SAMPLING_FREQUENCY_INVALID: return cString::sprintf("---");
case AUDIO_SAMPLING_FREQUENCY_RESERVED: return cString::sprintf("%s", tr("reserved"));
default: break;
}
return cString::sprintf("%d %s", value, tr("Hz"));
}
@@ -527,6 +503,7 @@ cString getAudioBitrate(double value, double stream)
case AUDIO_BITRATE_INVALID: return cString::sprintf("---");
case AUDIO_BITRATE_RESERVED: return cString::sprintf("%s (%s)", tr("reserved"), *getBitrateKbits(value));
case AUDIO_BITRATE_FREE: return cString::sprintf("%s (%s)", tr("free"), *getBitrateKbits(value));
default: break;
}
return cString::sprintf("%s (%s)", *getBitrateKbits(stream), *getBitrateKbits(value));
}
@@ -545,7 +522,89 @@ cString getBitrateMbits(double value)
cString getBitrateKbits(double value)
{
if (value > 0)
if (value > 0)
return cString::sprintf("%.0f %s", value / 1000.0, tr("kbit/s"));
return cString::sprintf("---");
}
cBitStream::cBitStream(const uint8_t *buf, const int len)
: data(buf),
count(len),
index(0)
{
}
cBitStream::~cBitStream()
{
}
int cBitStream::getBit()
{
if (index >= count)
return (1); // -> no infinite colomb's ...
int r = (data[index >> 3] >> (7 - (index & 7))) & 1;
++index;
return (r);
}
uint32_t cBitStream::getBits(uint32_t n)
{
uint32_t r = 0;
while (n--)
r = (r | (getBit() << n));
return (r);
}
void cBitStream::skipBits(uint32_t n)
{
index += n;
}
uint32_t cBitStream::getUeGolomb()
{
int n = 0;
while (!getBit() && (n < 32))
n++;
return (n ? ((1 << n) - 1) + getBits(n) : 0);
}
int32_t cBitStream::getSeGolomb()
{
uint32_t r = getUeGolomb() + 1;
return ((r & 1) ? -(r >> 1) : (r >> 1));
}
void cBitStream::skipGolomb()
{
int n = 0;
while (!getBit() && (n < 32))
n++;
skipBits(n);
}
void cBitStream::skipUeGolomb()
{
skipGolomb();
}
void cBitStream::skipSeGolomb()
{
skipGolomb();
}
void cBitStream::byteAlign()
{
int n = index % 8;
if (n > 0)
skipBits(8 - n);
}

View File

@@ -10,6 +10,7 @@
#include <stdint.h>
#include <vdr/channels.h>
#include <vdr/remux.h>
#include <vdr/tools.h>
#ifdef DEBUG
@@ -35,8 +36,7 @@ uint32_t getUNC(int cardIndex = 0);
cString getApids(const cChannel *channel);
cString getDpids(const cChannel *channel);
cString getSpids(const cChannel *channel);
cString getCAids(const cChannel *channel, bool identify = false);
cString getCA(int value);
cString getCAids(const cChannel *channel);
cString getVideoStream(int value);
cString getVideoCodec(int value);
cString getAudioStream(int value, const cChannel *channel);
@@ -49,8 +49,6 @@ cString getInversion(int value);
cString getHierarchy(int value);
cString getGuard(int value);
cString getModulation(int value);
cString getAlpha(int value);
cString getPriority(int value);
cString getSystem(int value);
cString getRollOff(int value);
cString getResolution(int width, int height, int scan);
@@ -71,4 +69,35 @@ cString getVideoBitrate(double value, double stream);
cString getBitrateMbits(double value);
cString getBitrateKbits(double value);
class cBitStream {
private:
const uint8_t *data;
int count; // in bits
int index; // in bits
public:
cBitStream(const uint8_t *buf, const int len);
~cBitStream();
int getBit();
uint32_t getBits(uint32_t n);
void skipBits(uint32_t n);
uint32_t getUeGolomb();
int32_t getSeGolomb();
void skipGolomb();
void skipUeGolomb();
void skipSeGolomb();
void byteAlign();
void skipBit() { skipBits(1); }
uint32_t getU8() { return getBits(8); }
uint32_t getU16() { return ((getBits(8) << 8) | getBits(8)); }
uint32_t getU24() { return ((getBits(8) << 16) | (getBits(8) << 8) | getBits(8)); }
uint32_t getU32() { return ((getBits(8) << 24) | (getBits(8) << 16) | (getBits(8) << 8) | getBits(8)); }
bool isEOF() { return (index >= count); }
void reset() { index = 0; }
int getIndex() { return (isEOF() ? count : index); }
const uint8_t *getData() { return (isEOF() ? NULL : data + (index / 8)); }
};
#endif // __FEMONTOOLS_H

View File

@@ -69,4 +69,25 @@ typedef struct video_info {
double bitrate; // Mbit/s
} video_info_t;
class cFemonVideoIf {
public:
cFemonVideoIf() {}
virtual ~cFemonVideoIf() {}
// eVideoCodec
virtual void SetVideoCodec(eVideoCodec codec) = 0;
// eVideoFormat
virtual void SetVideoFormat(eVideoFormat format) = 0;
// eVideoScan
virtual void SetVideoScan(eVideoScan scan) = 0;
// eVideoAspectRatio
virtual void SetVideoAspectRatio(eVideoAspectRatio aspectratio) = 0;
// pixels
virtual void SetVideoSize(int width, int height) = 0;
// Hz
virtual void SetVideoFramerate(double framerate) = 0;
// Mbit/s
virtual void SetVideoBitrate(double bitrate) = 0;
};
#endif //__FEMONVIDEO_H

View File

@@ -7,9 +7,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Christian Wieninger\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -89,21 +89,6 @@ msgstr "Position"
msgid "Define the position of OSD."
msgstr ""
msgid "Define the height of OSD."
msgstr ""
msgid "Horizontal offset"
msgstr "Horizontaler Offset"
msgid "Define the horizontal offset of OSD."
msgstr ""
msgid "Show CA system"
msgstr "CA System anzeigen"
msgid "Define whether the CA system is shown as text."
msgstr ""
msgid "Red limit [%]"
msgstr "Grenze Rot [%]"
@@ -182,15 +167,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "Satellitenkarte"
msgid "Cable Card"
msgstr "Kabelkarte"
msgid "Terrestrial Card"
msgstr "Terrestrische Karte"
msgid "Coderate"
msgstr "Coderate"
@@ -248,12 +224,6 @@ msgstr "Dolby Surround Modus"
msgid "Low Frequency Effects"
msgstr "Tieft<66>ner Effekte"
msgid "on"
msgstr "Ein"
msgid "off"
msgstr "Aus"
msgid "Dialogue Normalization"
msgstr "Dialog Normalisierung"
@@ -263,36 +233,6 @@ msgstr "Fest"
msgid "Analog"
msgstr "Analog"
msgid "SECA/Mediaguard"
msgstr "SECA/Mediaguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr ""
@@ -332,15 +272,6 @@ msgstr ""
msgid "mono"
msgstr ""
msgid "none"
msgstr "Nichts"
msgid "auto"
msgstr "Auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr ""
@@ -431,6 +362,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "nicht angegeben"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "frei"

View File

@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Luis Palacios\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -87,21 +87,6 @@ msgstr "Posici
msgid "Define the position of OSD."
msgstr ""
msgid "Define the height of OSD."
msgstr ""
msgid "Horizontal offset"
msgstr "Desplazamiento horizontal"
msgid "Define the horizontal offset of OSD."
msgstr ""
msgid "Show CA system"
msgstr "Mostrar sistema CA"
msgid "Define whether the CA system is shown as text."
msgstr ""
msgid "Red limit [%]"
msgstr "L<>mite de rojo [%s]"
@@ -180,15 +165,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "Tarjeta Sat<61>lite"
msgid "Cable Card"
msgstr "Tarjeta Cable"
msgid "Terrestrial Card"
msgstr "Tarjeta TDT"
msgid "Coderate"
msgstr "Coderate"
@@ -246,12 +222,6 @@ msgstr "Nivel sonoro Dolby Surround"
msgid "Low Frequency Effects"
msgstr "Efectos de baja frecuencia"
msgid "on"
msgstr "on"
msgid "off"
msgstr "off"
msgid "Dialogue Normalization"
msgstr "Normalizaci<63>n del di<64>logo"
@@ -261,36 +231,6 @@ msgstr "Fijo"
msgid "Analog"
msgstr "Anal<61>gico"
msgid "SECA/Mediaguard"
msgstr "SECA/Mediguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr ""
@@ -330,15 +270,6 @@ msgstr ""
msgid "mono"
msgstr "o"
msgid "none"
msgstr "ninguno"
msgid "auto"
msgstr "auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr ""
@@ -429,6 +360,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "no indicado"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "libre"

View File

@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Arthur Konovalov\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -87,21 +87,6 @@ msgstr "Positsioon"
msgid "Define the position of OSD."
msgstr ""
msgid "Define the height of OSD."
msgstr ""
msgid "Horizontal offset"
msgstr "Horisontaalne nihe"
msgid "Define the horizontal offset of OSD."
msgstr ""
msgid "Show CA system"
msgstr "N<>ita CA s<>steemi"
msgid "Define whether the CA system is shown as text."
msgstr ""
msgid "Red limit [%]"
msgstr "Punase limiit [%]"
@@ -180,15 +165,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "Satelliidikaart"
msgid "Cable Card"
msgstr "Kaablikaart"
msgid "Terrestrial Card"
msgstr "Terrestiaalkaart"
msgid "Coderate"
msgstr "Coderate"
@@ -246,12 +222,6 @@ msgstr "Dolby Surround'i t
msgid "Low Frequency Effects"
msgstr "LFE kanal"
msgid "on"
msgstr "Sees"
msgid "off"
msgstr "V<>ljas"
msgid "Dialogue Normalization"
msgstr "Dialoogi normalisatsioon"
@@ -261,36 +231,6 @@ msgstr "Fikseeritud"
msgid "Analog"
msgstr ""
msgid "SECA/Mediaguard"
msgstr "SECA/Mediaguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr ""
@@ -330,15 +270,6 @@ msgstr ""
msgid "mono"
msgstr ""
msgid "none"
msgstr "ei"
msgid "auto"
msgstr "auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr ""
@@ -429,6 +360,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "m<>rkimata"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "vaba"

View File

@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Rolf Ahrenberg\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -87,21 +87,6 @@ msgstr "Sijainti"
msgid "Define the position of OSD."
msgstr "Määrittele näytön sijainti."
msgid "Define the height of OSD."
msgstr "Määrittele näytön korkeus."
msgid "Horizontal offset"
msgstr "Vaakakeskitys"
msgid "Define the horizontal offset of OSD."
msgstr "Määrittele näytön vaakakeskitys."
msgid "Show CA system"
msgstr "Näytä salausjärjestelmä"
msgid "Define whether the CA system is shown as text."
msgstr "Määrittele, näytetään salausjärjestelmä tekstinä."
msgid "Red limit [%]"
msgstr "Punaisen taso [%]"
@@ -180,15 +165,6 @@ msgstr "Lähete-ID"
msgid "Rid"
msgstr "Radio-ID"
msgid "Satellite Card"
msgstr "Satelliittikortti"
msgid "Cable Card"
msgstr "Kaapelikortti"
msgid "Terrestrial Card"
msgstr "Terrestriaalikortti"
msgid "Coderate"
msgstr "Suojaustaso"
@@ -246,12 +222,6 @@ msgstr "Dolby Surround -tehoste"
msgid "Low Frequency Effects"
msgstr "LFE-kanava"
msgid "on"
msgstr "päällä"
msgid "off"
msgstr "poissa"
msgid "Dialogue Normalization"
msgstr "Dialogin normalisointi"
@@ -261,36 +231,6 @@ msgstr "kiinteä"
msgid "Analog"
msgstr "analoginen"
msgid "SECA/Mediaguard"
msgstr "SECA/Mediaguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr "MPEG-2"
@@ -330,15 +270,6 @@ msgstr "kaksikanavainen"
msgid "mono"
msgstr "mono"
msgid "none"
msgstr "ei"
msgid "auto"
msgstr "auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr "lomiteltu"
@@ -429,6 +360,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "ei ilmaistu"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "vapaa"

View File

@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2008-01-26 09:59+0100\n"
"Last-Translator: NIVAL Micha<68>l <mnival@club-internet.fr>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -87,21 +87,6 @@ msgstr "Position"
msgid "Define the position of OSD."
msgstr "D<>finit la position de l'OSD."
msgid "Define the height of OSD."
msgstr "D<>finit l'hauteur de l'OSD."
msgid "Horizontal offset"
msgstr "D<>placement horizontal"
msgid "Define the horizontal offset of OSD."
msgstr "D<>finit le d<>placement horizontal de l'OSD."
msgid "Show CA system"
msgstr "Afficher syst<73>me CA"
msgid "Define whether the CA system is shown as text."
msgstr "D<>finit si le syst<73>me CA doit <20>tre affich<63>."
msgid "Red limit [%]"
msgstr "Limite du rouge (%)"
@@ -180,15 +165,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "Carte Satellite"
msgid "Cable Card"
msgstr "Carte C<>ble"
msgid "Terrestrial Card"
msgstr "Carte TNT"
msgid "Coderate"
msgstr "Coderate"
@@ -246,12 +222,6 @@ msgstr "Mode Dolby Surround"
msgid "Low Frequency Effects"
msgstr "Effets de basses"
msgid "on"
msgstr "Oui"
msgid "off"
msgstr "Non"
msgid "Dialogue Normalization"
msgstr "Normalisation des dialogues"
@@ -261,36 +231,6 @@ msgstr "Fixe"
msgid "Analog"
msgstr "Analogique"
msgid "SECA/Mediaguard"
msgstr "SECA/Mediaguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr ""
@@ -330,15 +270,6 @@ msgstr ""
msgid "mono"
msgstr ""
msgid "none"
msgstr "Aucun"
msgid "auto"
msgstr "Auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr ""
@@ -429,6 +360,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "non indiqu<71>"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "libre"

View File

@@ -6,9 +6,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2008-11-10 23:37+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -88,21 +88,6 @@ msgstr "Posizione"
msgid "Define the position of OSD."
msgstr "Definisci la posizione dell'OSD."
msgid "Define the height of OSD."
msgstr "Definisci l'altezza dell'OSD."
msgid "Horizontal offset"
msgstr "Limite orizzontale"
msgid "Define the horizontal offset of OSD."
msgstr "Definisci il limite orizzontale dell'OSD."
msgid "Show CA system"
msgstr "Mostra sistema CA"
msgid "Define whether the CA system is shown as text."
msgstr "Definisci se il sistema CA viene mostrato come testo."
msgid "Red limit [%]"
msgstr "Limite rosso [%]"
@@ -181,15 +166,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "Scheda satellite"
msgid "Cable Card"
msgstr "Scheda via cavo"
msgid "Terrestrial Card"
msgstr "Scheda terrestre"
msgid "Coderate"
msgstr "Coderate"
@@ -247,12 +223,6 @@ msgstr "Modalit
msgid "Low Frequency Effects"
msgstr "Effetti bassa frequenza"
msgid "on"
msgstr "Attivo"
msgid "off"
msgstr "Disattivo"
msgid "Dialogue Normalization"
msgstr "Normalizzazione dialoghi"
@@ -262,36 +232,6 @@ msgstr "Fisso"
msgid "Analog"
msgstr "Analogico"
msgid "SECA/Mediaguard"
msgstr "SECA/Mediaguard"
msgid "Viaccess"
msgstr "Viaccess"
msgid "Irdeto"
msgstr "Irdeto"
msgid "NDS/Videoguard"
msgstr "NDS/Videoguard"
msgid "Conax"
msgstr "Conax"
msgid "CryptoWorks"
msgstr "CryptoWorks"
msgid "PowerVu"
msgstr "PowerVu"
msgid "NagraVision"
msgstr "NagraVision"
msgid "BetaCrypt"
msgstr "BetaCrypt"
msgid "SkyCrypt"
msgstr "SkyCrypt"
msgid "MPEG-2"
msgstr "MPEG-2"
@@ -331,15 +271,6 @@ msgstr "dual"
msgid "mono"
msgstr "mono"
msgid "none"
msgstr "nessuna"
msgid "auto"
msgstr "auto"
msgid "MHz"
msgstr "MHz"
msgid "interlaced"
msgstr "interlacciato"
@@ -430,6 +361,9 @@ msgstr "dB"
msgid "not indicated"
msgstr "non indicato"
msgid "MHz"
msgstr "MHz"
msgid "free"
msgstr "libero"

View File

@@ -5,9 +5,9 @@
#
msgid ""
msgstr ""
"Project-Id-Version: femon 1.6.4\n"
"Project-Id-Version: femon 1.7.3\n"
"Report-Msgid-Bugs-To: Rolf Ahrenberg\n"
"POT-Creation-Date: 2008-11-09 13:31+0200\n"
"POT-Creation-Date: 2009-08-29 20:57+0300\n"
"PO-Revision-Date: 2007-08-12 23:22+0300\n"
"Last-Translator: Vyacheslav Dikonov\n"
"Language-Team: <vdr@linuxtv.org>\n"
@@ -87,21 +87,6 @@ msgstr "
msgid "Define the position of OSD."
msgstr ""
msgid "Define the height of OSD."
msgstr ""
msgid "Horizontal offset"
msgstr ""
msgid "Define the horizontal offset of OSD."
msgstr ""
msgid "Show CA system"
msgstr ""
msgid "Define whether the CA system is shown as text."
msgstr ""
msgid "Red limit [%]"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> (%)"
@@ -180,15 +165,6 @@ msgstr "Tid"
msgid "Rid"
msgstr "Rid"
msgid "Satellite Card"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
msgid "Cable Card"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
msgid "Terrestrial Card"
msgstr "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
msgid "Coderate"
msgstr "Coderate"
@@ -246,12 +222,6 @@ msgstr ""
msgid "Low Frequency Effects"
msgstr ""
msgid "on"
msgstr "<22><><EFBFBD>"
msgid "off"
msgstr "<22><><EFBFBD><EFBFBD>"
msgid "Dialogue Normalization"
msgstr ""
@@ -261,36 +231,6 @@ msgstr ""
msgid "Analog"
msgstr ""
msgid "SECA/Mediaguard"
msgstr ""
msgid "Viaccess"
msgstr ""
msgid "Irdeto"
msgstr ""
msgid "NDS/Videoguard"
msgstr ""
msgid "Conax"
msgstr ""
msgid "CryptoWorks"
msgstr ""
msgid "PowerVu"
msgstr ""
msgid "NagraVision"
msgstr ""
msgid "BetaCrypt"
msgstr ""
msgid "SkyCrypt"
msgstr ""
msgid "MPEG-2"
msgstr ""
@@ -330,15 +270,6 @@ msgstr ""
msgid "mono"
msgstr ""
msgid "none"
msgstr "<22><><EFBFBD>"
msgid "auto"
msgstr "<22><><EFBFBD><EFBFBD>"
msgid "MHz"
msgstr "<22><><EFBFBD>"
msgid "interlaced"
msgstr ""
@@ -429,6 +360,9 @@ msgstr "dB"
msgid "not indicated"
msgstr ""
msgid "MHz"
msgstr "<22><><EFBFBD>"
msgid "free"
msgstr ""