aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fig/FIG.h2
-rw-r--r--src/fig/FIG0.cpp80
-rw-r--r--src/fig/FIG0.h19
-rw-r--r--src/fig/FIGCarousel.cpp87
-rw-r--r--src/fig/FIGCarousel.h1
5 files changed, 116 insertions, 73 deletions
diff --git a/src/fig/FIG.h b/src/fig/FIG.h
index 90dd872..915e5f3 100644
--- a/src/fig/FIG.h
+++ b/src/fig/FIG.h
@@ -33,6 +33,8 @@
struct FIGRuntimeInformation {
unsigned long currentFrame;
boost::shared_ptr<dabEnsemble> ensemble;
+ bool factumAnalyzer;
+
};
// Recommended FIG rates according to ETSI TR 101 496-2 Table 3.6.1
diff --git a/src/fig/FIG0.cpp b/src/fig/FIG0.cpp
index 70d1f93..a255445 100644
--- a/src/fig/FIG0.cpp
+++ b/src/fig/FIG0.cpp
@@ -304,3 +304,83 @@ size_t FIG0_2::fill(uint8_t *buf, size_t max_size)
return max_size - remaining;
}
+//=========== FIG 0/3 ===========
+
+FIG0_3::FIG0_3(FIGRuntimeInformation *rti) :
+ m_rti(rti)
+{
+}
+
+size_t FIG0_3::fill(uint8_t *buf, size_t max_size)
+{
+ ssize_t remaining = max_size;
+
+ FIGtype0_3_header *fig0_3_header = NULL;
+ FIGtype0_3_data *fig0_3_data = NULL;
+
+ for (auto& component : m_rti->ensemble->components) {
+ auto subchannel = getSubchannel(m_rti->ensemble->subchannels,
+ component->subchId);
+
+ if (subchannel == m_rti->ensemble->subchannels.end()) {
+ etiLog.log(error,
+ "Subchannel %i does not exist for component "
+ "of service %i\n",
+ component->subchId, component->serviceId);
+ throw MuxInitException();
+ }
+
+ if ((*subchannel)->type != Packet)
+ continue;
+
+ if (fig0_3_header == NULL) {
+ fig0_3_header = (FIGtype0_3_header*)buf;
+ fig0_3_header->FIGtypeNumber = 0;
+ fig0_3_header->Length = 1;
+ fig0_3_header->CN = 0;
+ fig0_3_header->OE = 0;
+ fig0_3_header->PD = 0;
+ fig0_3_header->Extension = 3;
+
+ buf += 2;
+ remaining -= 2;
+ }
+
+ /* Warning: When bit SCCA_flag is unset(0), the multiplexer
+ * R&S does not send the SCCA field. But, in the Factum ETI
+ * analyzer, if this field is not there, it is an error.
+ */
+ fig0_3_data = (FIGtype0_3_data*)buf;
+ fig0_3_data->setSCId(component->packet.id);
+ fig0_3_data->rfa = 0;
+ fig0_3_data->SCCA_flag = 0;
+ // if 0, datagroups are used
+ fig0_3_data->DG_flag = !component->packet.datagroup;
+ fig0_3_data->rfu = 0;
+ fig0_3_data->DSCTy = component->type;
+ fig0_3_data->SubChId = (*subchannel)->id;
+ fig0_3_data->setPacketAddress(component->packet.address);
+ if (m_rti->factumAnalyzer) {
+ fig0_3_data->SCCA = 0;
+ }
+
+ fig0_3_header->Length += 5;
+ buf += 5;
+ remaining -= 5;
+ if (m_rti->factumAnalyzer) {
+ fig0_3_header->Length += 2;
+ buf += 2;
+ remaining -= 2;
+ }
+
+ if (remaining < 0) {
+ etiLog.level(error) <<
+ "can't add FIG 0/3 to FIB, "
+ "too many packet services";
+ throw MuxInitException();
+ }
+ }
+
+ return max_size - remaining;
+}
+
diff --git a/src/fig/FIG0.h b/src/fig/FIG0.h
index 625e2ae..3530e5f 100644
--- a/src/fig/FIG0.h
+++ b/src/fig/FIG0.h
@@ -74,12 +74,29 @@ class FIG0_2 : public IFIG
virtual FIG_rate repetition_rate(void) { return FIG_rate::A; }
virtual const int figtype(void) const { return 0; }
- virtual const int figextension(void) const { return 1; }
+ virtual const int figextension(void) const { return 2; }
private:
FIGRuntimeInformation *m_rti;
std::vector<std::shared_ptr<DabService> >::iterator serviceFIG0_2;
};
+// FIG type 0/3
+// The Extension 3 of FIG type 0 (FIG 0/3) gives additional information about
+// the service component description in packet mode.
+class FIG0_3 : public IFIG
+{
+ public:
+ FIG0_3(FIGRuntimeInformation* rti);
+ virtual size_t fill(uint8_t *buf, size_t max_size);
+ virtual FIG_rate repetition_rate(void) { return FIG_rate::A; }
+
+ virtual const int figtype(void) const { return 0; }
+ virtual const int figextension(void) const { return 3; }
+
+ private:
+ FIGRuntimeInformation *m_rti;
+};
+
#endif // __FIG0_H_
diff --git a/src/fig/FIGCarousel.cpp b/src/fig/FIGCarousel.cpp
index b1377e4..235cf66 100644
--- a/src/fig/FIGCarousel.cpp
+++ b/src/fig/FIGCarousel.cpp
@@ -29,6 +29,7 @@
#include "fig/FIGCarousel.h"
#include <iostream>
+/**************** FIGCarouselElement ****************/
void FIGCarouselElement::reduce_deadline()
{
deadline -= rate_increment_ms(fig->repetition_rate());
@@ -39,20 +40,29 @@ void FIGCarouselElement::reduce_deadline()
}
}
+
+/**************** FIGCarousel *****************/
+
FIGCarousel::FIGCarousel(boost::shared_ptr<dabEnsemble> ensemble) :
m_fig0_0(&m_rti),
m_fig0_1(&m_rti),
- m_fig0_2(&m_rti)
+ m_fig0_2(&m_rti),
+ m_fig0_3(&m_rti)
{
m_rti.ensemble = ensemble;
m_rti.currentFrame = 0;
+ m_rti.factumAnalyzer = false;
+
m_figs_available[std::make_pair(0, 0)] = &m_fig0_0;
m_figs_available[std::make_pair(0, 1)] = &m_fig0_1;
m_figs_available[std::make_pair(0, 2)] = &m_fig0_2;
+ m_figs_available[std::make_pair(0, 3)] = &m_fig0_3;
- allocate_fig_to_fib(0, 0, 0);
- allocate_fig_to_fib(0, 1, 0);
- allocate_fig_to_fib(0, 2, 0);
+ const int fib0 = 0;
+ allocate_fig_to_fib(0, 0, fib0);
+ allocate_fig_to_fib(0, 1, fib0);
+ allocate_fig_to_fib(0, 2, fib0);
+ allocate_fig_to_fib(0, 3, fib0);
}
void FIGCarousel::set_currentFrame(unsigned long currentFrame)
@@ -170,74 +180,7 @@ void fib0 {
break;
case 5:
- fig0_3_header = NULL;
-
- for (component = ensemble->components.begin();
- component != ensemble->components.end();
- ++component) {
- subchannel = getSubchannel(ensemble->subchannels,
- (*component)->subchId);
-
- if (subchannel == ensemble->subchannels.end()) {
- etiLog.log(error,
- "Subchannel %i does not exist for component "
- "of service %i\n",
- (*component)->subchId, (*component)->serviceId);
- throw MuxInitException();
- }
-
- if ((*subchannel)->type != Packet)
- continue;
-
- if (fig0_3_header == NULL) {
- fig0_3_header = (FIGtype0_3_header*)&etiFrame[index];
- fig0_3_header->FIGtypeNumber = 0;
- fig0_3_header->Length = 1;
- fig0_3_header->CN = 0;
- fig0_3_header->OE = 0;
- fig0_3_header->PD = 0;
- fig0_3_header->Extension = 3;
-
- index += 2;
- figSize += 2;
- }
-
- bool factumAnalyzer = m_pt.get("general.writescca", false);
-
- /* Warning: When bit SCCA_flag is unset(0), the multiplexer
- * R&S does not send the SCCA field. But, in the Factum ETI
- * analyzer, if this field is not there, it is an error.
- */
- fig0_3_data = (FIGtype0_3_data*)&etiFrame[index];
- fig0_3_data->setSCId((*component)->packet.id);
- fig0_3_data->rfa = 0;
- fig0_3_data->SCCA_flag = 0;
- // if 0, datagroups are used
- fig0_3_data->DG_flag = !(*component)->packet.datagroup;
- fig0_3_data->rfu = 0;
- fig0_3_data->DSCTy = (*component)->type;
- fig0_3_data->SubChId = (*subchannel)->id;
- fig0_3_data->setPacketAddress((*component)->packet.address);
- if (factumAnalyzer) {
- fig0_3_data->SCCA = 0;
- }
-
- fig0_3_header->Length += 5;
- index += 5;
- figSize += 5;
- if (factumAnalyzer) {
- fig0_3_header->Length += 2;
- index += 2;
- figSize += 2;
- }
-
- if (figSize > 30) {
- etiLog.log(error,
- "can't add to Fic Fig 0/3, "
- "too much packet service\n");
- throw MuxInitException();
- }
- }
+ // ERASED
break;
case 7:
diff --git a/src/fig/FIGCarousel.h b/src/fig/FIGCarousel.h
index 42b8d9c..84299ac 100644
--- a/src/fig/FIGCarousel.h
+++ b/src/fig/FIGCarousel.h
@@ -63,6 +63,7 @@ class FIGCarousel {
FIG0_0 m_fig0_0;
FIG0_1 m_fig0_1;
FIG0_2 m_fig0_2;
+ FIG0_3 m_fig0_3;
};
#endif // __FIG_CAROUSEL_H_