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)  

alaw-encode.c File Reference
#include <gst/audio/audio.h>
#include "alaw-encode.h"
Include dependency graph for alaw-encode.c:

Go to the source code of this file.

Macros

#define GST_CAT_DEFAULT   alaw_enc_debug
 
#define GST_ALAW_ENC_USE_TABLE
 

Functions

 GST_DEBUG_CATEGORY_STATIC (alaw_enc_debug)
 
 G_DEFINE_TYPE (GstALawEnc, gst_alaw_enc, GST_TYPE_AUDIO_ENCODER)
 
 GST_ELEMENT_REGISTER_DEFINE (alawenc, "alawenc", GST_RANK_PRIMARY,(gst_alaw_enc_get_type()))
 
static gboolean gst_alaw_enc_start (GstAudioEncoder *audioenc)
 
static gboolean gst_alaw_enc_set_format (GstAudioEncoder *enc, GstAudioInfo *info)
 
static GstFlowReturn gst_alaw_enc_handle_frame (GstAudioEncoder *enc, GstBuffer *buffer)
 
static guint8 s16_to_alaw (gint16 pcm_val)
 
static void gst_alaw_enc_class_init (GstALawEncClass *klass)
 
static void gst_alaw_enc_init (GstALawEnc *alawenc)
 

Variables

GstStaticPadTemplate alaw_enc_src_factory
 
GstStaticPadTemplate alaw_enc_sink_factory
 
static const guint8 alaw_encode [2048+1]
 

Macro Definition Documentation

◆ GST_ALAW_ENC_USE_TABLE

#define GST_ALAW_ENC_USE_TABLE

Definition at line 52 of file alaw-encode.c.

◆ GST_CAT_DEFAULT

#define GST_CAT_DEFAULT   alaw_enc_debug

Definition at line 35 of file alaw-encode.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstALawEnc  ,
gst_alaw_enc  ,
GST_TYPE_AUDIO_ENCODER   
)

◆ gst_alaw_enc_class_init()

static void gst_alaw_enc_class_init ( GstALawEncClass klass)
static

◆ gst_alaw_enc_handle_frame()

static GstFlowReturn gst_alaw_enc_handle_frame ( GstAudioEncoder *  enc,
GstBuffer *  buffer 
)
static

Definition at line 365 of file alaw-encode.c.

References _GstALawEnc::channels, GST_ALAW_ENC, _GstALawEnc::rate, and s16_to_alaw().

Referenced by gst_alaw_enc_class_init().

◆ gst_alaw_enc_init()

static void gst_alaw_enc_init ( GstALawEnc alawenc)
static

Definition at line 444 of file alaw-encode.c.

◆ gst_alaw_enc_set_format()

static gboolean gst_alaw_enc_set_format ( GstAudioEncoder *  enc,
GstAudioInfo *  info 
)
static

Definition at line 336 of file alaw-encode.c.

References _GstALawEnc::channels, GST_ALAW_ENC, and _GstALawEnc::rate.

Referenced by gst_alaw_enc_class_init().

◆ gst_alaw_enc_start()

static gboolean gst_alaw_enc_start ( GstAudioEncoder *  audioenc)
static

Definition at line 325 of file alaw-encode.c.

References _GstALawEnc::channels, GST_ALAW_ENC, and _GstALawEnc::rate.

Referenced by gst_alaw_enc_class_init().

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( alaw_enc_debug  )

SECTION:element-alawenc @title: alawenc

This element encode alaw audio. Alaw coding is also known as G.711.

◆ GST_ELEMENT_REGISTER_DEFINE()

GST_ELEMENT_REGISTER_DEFINE ( alawenc  ,
"alawenc"  ,
GST_RANK_PRIMARY  ,
(gst_alaw_enc_get_type())   
)

◆ s16_to_alaw()

static guint8 s16_to_alaw ( gint16  pcm_val)
inlinestatic

Definition at line 231 of file alaw-encode.c.

References alaw_encode.

Referenced by gst_alaw_enc_handle_frame().

Variable Documentation

◆ alaw_enc_sink_factory

GstStaticPadTemplate alaw_enc_sink_factory
Initial value:
= GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw, "
"format = (string) " GST_AUDIO_NE (S16) ", "
"layout = (string) interleaved, "
"rate = (int) [ 8000, 192000 ], " "channels = (int) [ 1, 2 ]")
)

Definition at line 308 of file alaw-encode.c.

Referenced by gst_alaw_enc_class_init().

◆ alaw_enc_src_factory

GstStaticPadTemplate alaw_enc_src_factory
Initial value:
= GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-alaw, "
"rate = [ 8000 , 192000 ], " "channels = [ 1 , 2 ]")
)

Definition at line 317 of file alaw-encode.c.

Referenced by gst_alaw_enc_class_init().

◆ alaw_encode

const guint8 alaw_encode[2048+1]
static

Definition at line 56 of file alaw-encode.c.

Referenced by s16_to_alaw().