diff options
Diffstat (limited to 'src/codec/ecu.c')
-rw-r--r-- | src/codec/ecu.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/codec/ecu.c b/src/codec/ecu.c index db7148ce..cdb3e62e 100644 --- a/src/codec/ecu.c +++ b/src/codec/ecu.c @@ -14,10 +14,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ /* As the developer and copyright holder of the related code, I hereby @@ -48,7 +44,7 @@ static const struct osmo_ecu_ops *g_ecu_ops[_NUM_OSMO_ECU_CODECS]; /*! initialize an ECU instance for given codec. * \param[in] ctx talloc context from which to allocate - * \parma[in] codec codec for which to initialize/create ECU */ + * \param[in] codec codec for which to initialize/create ECU */ struct osmo_ecu_state *osmo_ecu_init(void *ctx, enum osmo_ecu_codec codec) { if (codec >= ARRAY_SIZE(g_ecu_ops)) @@ -100,6 +96,20 @@ int osmo_ecu_frame_out(struct osmo_ecu_state *st, uint8_t *frame_out) return g_ecu_ops[st->codec]->frame_out(st, frame_out); } +/*! check if the current state of this ECU is a DTX pause. + * \param[in] st ECU state/instance on which to operate + * \return true if DTX pause, false otherwise */ +bool osmo_ecu_is_dtx_pause(struct osmo_ecu_state *st) +{ + if (st->codec >= ARRAY_SIZE(g_ecu_ops)) + return false; + if (!g_ecu_ops[st->codec]) + return false; + if (!g_ecu_ops[st->codec]->is_dtx_pause) + return false; + return g_ecu_ops[st->codec]->is_dtx_pause(st); +} + /*********************************************************************** * low-level API for ECU implementations ***********************************************************************/ |