gst-plugins-good  1.20.3
About: GStreamer (Good Plugins) is a library for constructing of graphs of media-handling components. A set of good-quality plug-ins (under LGPL license).
  Fossies Dox: gst-plugins-good-1.20.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

gstsbcparse.c File Reference
#include "gstaudioparserselements.h"
#include "gstsbcparse.h"
#include <string.h>
#include <gst/tag/tag.h>
#include <gst/audio/audio.h>
#include <gst/base/base.h>
#include <gst/pbutils/pbutils.h>
Include dependency graph for gstsbcparse.c:

Go to the source code of this file.

Macros

#define SBC_SYNCBYTE   0x9C
 
#define GST_CAT_DEFAULT   sbcparse_debug
 
#define parent_class   gst_sbc_parse_parent_class
 

Functions

 GST_DEBUG_CATEGORY_STATIC (sbcparse_debug)
 
static gboolean gst_sbc_parse_start (GstBaseParse *parse)
 
static gboolean gst_sbc_parse_stop (GstBaseParse *parse)
 
static GstFlowReturn gst_sbc_parse_handle_frame (GstBaseParse *parse, GstBaseParseFrame *frame, gint *skipsize)
 
static GstFlowReturn gst_sbc_parse_pre_push_frame (GstBaseParse *parse, GstBaseParseFrame *frame)
 
static GstCaps * gst_sbc_parse_get_sink_caps (GstBaseParse *parse, GstCaps *filter)
 
static guint8 gst_sbc_calculate_crc8 (const guint8 *data, gint bits_crc)
 
static gsize gst_sbc_calc_framelen (guint subbands, GstSbcChannelMode ch_mode, guint blocks, guint bitpool)
 
static gsize gst_sbc_parse_header (const guint8 *data, guint *rate, guint *n_blocks, GstSbcChannelMode *ch_mode, GstSbcAllocationMethod *alloc_method, guint *n_subbands, guint *bitpool)
 
 G_DEFINE_TYPE (GstSbcParse, gst_sbc_parse, GST_TYPE_BASE_PARSE)
 
 GST_ELEMENT_REGISTER_DEFINE (sbcparse, "sbcparse", GST_RANK_PRIMARY+1,(gst_sbc_parse_get_type()))
 
static void gst_sbc_parse_class_init (GstSbcParseClass *klass)
 
static void gst_sbc_parse_reset (GstSbcParse *sbcparse)
 
static void gst_sbc_parse_init (GstSbcParse *sbcparse)
 
static const gchar * gst_sbc_channel_mode_get_name (GstSbcChannelMode ch_mode)
 
static const gchar * gst_sbc_allocation_method_get_name (GstSbcAllocationMethod alloc_method)
 
static void remove_fields (GstCaps *caps)
 

Variables

static GstStaticPadTemplate src_factory
 
static GstStaticPadTemplate sink_factory
 
static const guint8 crc_table [256]
 

Macro Definition Documentation

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   sbcparse_debug

Definition at line 51 of file gstsbcparse.c.

◆ parent_class

#define parent_class   gst_sbc_parse_parent_class

Definition at line 83 of file gstsbcparse.c.

◆ SBC_SYNCBYTE

#define SBC_SYNCBYTE   0x9C

SECTION:element-sbcparse @title: sbcparse @see_also: sbcdec, sbcenc

The sbcparse element will parse a bluetooth SBC audio stream into frames and timestamp them properly.

Since: 1.2.0

Definition at line 48 of file gstsbcparse.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstSbcParse  ,
gst_sbc_parse  ,
GST_TYPE_BASE_PARSE   
)

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( sbcparse_debug  )

◆ GST_ELEMENT_REGISTER_DEFINE()

GST_ELEMENT_REGISTER_DEFINE ( sbcparse  ,
"sbcparse"  ,
GST_RANK_PRIMARY+  1,
(gst_sbc_parse_get_type())   
)

◆ gst_sbc_allocation_method_get_name()

static const gchar * gst_sbc_allocation_method_get_name ( GstSbcAllocationMethod  alloc_method)
static

◆ gst_sbc_calc_framelen()

static gsize gst_sbc_calc_framelen ( guint  subbands,
GstSbcChannelMode  ch_mode,
guint  blocks,
guint  bitpool 
)
static

◆ gst_sbc_calculate_crc8()

static guint8 gst_sbc_calculate_crc8 ( const guint8 *  data,
gint  bits_crc 
)
static

Definition at line 398 of file gstsbcparse.c.

References crc_table.

Referenced by gst_sbc_parse_header().

◆ gst_sbc_channel_mode_get_name()

static const gchar * gst_sbc_channel_mode_get_name ( GstSbcChannelMode  ch_mode)
static

◆ gst_sbc_parse_class_init()

◆ gst_sbc_parse_get_sink_caps()

static GstCaps * gst_sbc_parse_get_sink_caps ( GstBaseParse *  parse,
GstCaps *  filter 
)
static

Definition at line 323 of file gstsbcparse.c.

References remove_fields().

Referenced by gst_sbc_parse_class_init().

◆ gst_sbc_parse_handle_frame()

◆ gst_sbc_parse_header()

static gsize gst_sbc_parse_header ( const guint8 *  data,
guint *  rate,
guint *  n_blocks,
GstSbcChannelMode ch_mode,
GstSbcAllocationMethod alloc_method,
guint *  n_subbands,
guint *  bitpool 
)
static

◆ gst_sbc_parse_init()

static void gst_sbc_parse_init ( GstSbcParse sbcparse)
static

Definition at line 126 of file gstsbcparse.c.

References gst_sbc_parse_reset().

◆ gst_sbc_parse_pre_push_frame()

static GstFlowReturn gst_sbc_parse_pre_push_frame ( GstBaseParse *  parse,
GstBaseParseFrame *  frame 
)
static

Definition at line 504 of file gstsbcparse.c.

References GST_SBC_PARSE, and _GstSbcParse::sent_codec_tag.

Referenced by gst_sbc_parse_class_init().

◆ gst_sbc_parse_reset()

◆ gst_sbc_parse_start()

static gboolean gst_sbc_parse_start ( GstBaseParse *  parse)
static

Definition at line 134 of file gstsbcparse.c.

References gst_sbc_calc_framelen(), and GST_SBC_CHANNEL_MODE_MONO.

Referenced by gst_sbc_parse_class_init().

◆ gst_sbc_parse_stop()

static gboolean gst_sbc_parse_stop ( GstBaseParse *  parse)
static

Definition at line 147 of file gstsbcparse.c.

References GST_SBC_PARSE, and gst_sbc_parse_reset().

Referenced by gst_sbc_parse_class_init().

◆ remove_fields()

static void remove_fields ( GstCaps *  caps)
static

Definition at line 310 of file gstsbcparse.c.

Referenced by gst_sbc_parse_get_sink_caps().

Variable Documentation

◆ crc_table

const guint8 crc_table[256]
static

Definition at line 362 of file gstsbcparse.c.

Referenced by gst_sbc_calculate_crc8().

◆ sink_factory

GstStaticPadTemplate sink_factory
static
Initial value:
= GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
)

Definition at line 61 of file gstsbcparse.c.

Referenced by gst_sbc_parse_class_init().

◆ src_factory

GstStaticPadTemplate src_factory
static
Initial value:
= GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-sbc, parsed = (boolean) true, "
"channels = (int) [ 1, 2 ], "
"rate = (int) { 16000, 32000, 44100, 48000 }")
)

Definition at line 53 of file gstsbcparse.c.

Referenced by gst_sbc_parse_class_init().