GNU Radio C++ API Reference: atsc_plinfo.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
atsc_plinfo.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2001,2006,2014 Free Software Foundation, Inc.
4 *
5 * This file is part of GNU Radio
6 *
7 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef DTV_INCLUDED_ATSC_PLINFO_H
12#define DTV_INCLUDED_ATSC_PLINFO_H
13
14#include <gnuradio/dtv/atsc_consts.h>
15#include <cassert>
16#include <cstdint>
17#include <cstring>
18
19#include <gnuradio/dtv/api.h>
20
21namespace gr {
22namespace dtv {
23
24/*!
25 * \brief pipeline info that flows with data
26 *
27 * Not all modules need all the info
28 */
29 class DTV_API plinfo
30{
31public:
32 plinfo();
33 plinfo(uint16_t flags, int16_t segno);
34
35 /**
36 * @brief Resets the flags and segno fields
37 *
38 */
39 void reset();
40
41 // accessors
42 bool field_sync1_p() const;
43 bool field_sync2_p() const;
44 bool field_sync_p() const;
45
46 bool regular_seg_p() const;
47
48 bool in_field1_p() const;
49 bool in_field2_p() const;
50
51 bool first_regular_seg_p() const;
52
53 bool transport_error_p() const;
54
55 unsigned int segno() const;
56 unsigned int flags() const;
57
58 // setters
59
60 void set_field_sync1();
61
62 void set_field_sync2();
63
64 void set_regular_seg(bool field2, int segno);
65
66 void set_transport_error(bool error);
67
68 /*!
69 * Set \p OUT such that it reflects a \p NSEGS_OF_DELAY
70 * pipeline delay from \p IN.
71 */
72 static void delay(plinfo& out, const plinfo& in, int nsegs_of_delay);
73
74 // these three are mutually exclusive
75 // This is a regular data segment.
76 static constexpr int fl_regular_seg = 0x0001;
77 // This is a field sync segment, for 1st half of a field.
78 static constexpr int fl_field_sync1 = 0x0002;
79 // This is a field sync segment, for 2nd half of a field.
80 static constexpr int fl_field_sync2 = 0x0004;
81
82 // This bit is on ONLY when fl_regular_seg is set AND when this is
83 // the first regular data segment AFTER a field sync segment. This
84 // segment causes various processing modules to reset.
85 static constexpr int fl_first_regular_seg = 0x0008;
86
87 // which field are we in?
88 static constexpr int fl_field2 = 0x0010; // else field 1
89
90 // This bit is set when Reed-Solomon decoding detects an error that it
91 // can't correct. Note that other error detection (e.g. Viterbi) do not
92 // set it, since Reed-Solomon will correct many of those. This bit is
93 // then copied into the final Transport Stream packet so that MPEG
94 // software can see that the 188-byte data segment has been corrupted.
95 static constexpr int fl_transport_error = 0x0020;
96
97private:
98 uint16_t d_flags = 0; // bitmask
99 int16_t d_segno = 0; // segment number [-1,311] -1 is the field sync segment
100};
101
102} /* namespace dtv */
103} /* namespace gr */
104
105#endif /* _ATSC_PLINFO_H_ */
atsc_consts.h
gr::dtv::plinfo::segno
unsigned int segno() const
gr::dtv::plinfo::in_field1_p
bool in_field1_p() const
gr::dtv::plinfo::field_sync_p
bool field_sync_p() const
gr::dtv::plinfo::set_regular_seg
void set_regular_seg(bool field2, int segno)
gr::dtv::plinfo::set_transport_error
void set_transport_error(bool error)
gr::dtv::plinfo::fl_field2
static constexpr int fl_field2
Definition atsc_plinfo.h:88
gr::dtv::plinfo::transport_error_p
bool transport_error_p() const
gr::dtv::plinfo::in_field2_p
bool in_field2_p() const
gr::dtv::plinfo::flags
unsigned int flags() const
gr::dtv::plinfo::fl_field_sync2
static constexpr int fl_field_sync2
Definition atsc_plinfo.h:80
gr::dtv::plinfo::regular_seg_p
bool regular_seg_p() const
gr::dtv::plinfo::set_field_sync2
void set_field_sync2()
gr::dtv::plinfo::delay
static void delay(plinfo &out, const plinfo &in, int nsegs_of_delay)
gr::dtv::plinfo::set_field_sync1
void set_field_sync1()
gr::dtv::plinfo::reset
void reset()
Resets the flags and segno fields.
gr::dtv::plinfo::fl_field_sync1
static constexpr int fl_field_sync1
Definition atsc_plinfo.h:78
gr::dtv::plinfo::plinfo
plinfo()
gr::dtv::plinfo::plinfo
plinfo(uint16_t flags, int16_t segno)
gr::dtv::plinfo::fl_transport_error
static constexpr int fl_transport_error
Definition atsc_plinfo.h:95
gr::dtv::plinfo::fl_regular_seg
static constexpr int fl_regular_seg
Definition atsc_plinfo.h:76
gr::dtv::plinfo::field_sync1_p
bool field_sync1_p() const
gr::dtv::plinfo::field_sync2_p
bool field_sync2_p() const
gr::dtv::plinfo::first_regular_seg_p
bool first_regular_seg_p() const
gr::dtv::plinfo::fl_first_regular_seg
static constexpr int fl_first_regular_seg
Definition atsc_plinfo.h:85
api.h
DTV_API
#define DTV_API
Definition gr-dtv/include/gnuradio/dtv/api.h:18
gr::dtv
Definition atsc_consts.h:17
gr
GNU Radio logging wrapper.
Definition basic_block.h:29