xine-lib: xine-lib-1.2.12/src/post/visualizations/tdaudioanalyzer.c File Reference

xine-lib 1.2.12

Data Structures | Macros | Functions | Variables
tdaudioanalyzer.c File Reference
`#include <stdio.h>`
`#include <xine/xine_internal.h>`
`#include <xine/xineutils.h>`
`#include <xine/post.h>`
`#include "visualizations.h"`

## Data Structures
struct | tdaan_leveller_t
struct | post_plugin_tdaan_t
union | yuy2_color_t

## Macros
#define | RING_LOG2 13
#define | RING_SIZE (1 << RING_LOG2)
#define | RING_MASK (RING_SIZE - 1)
#define | __ 255
#define | __ {{128, 128, 128, 128}}
#define | _o {{128, 128, 16, 128}}
#define | o_ {{ 16, 128, 128, 128}}
#define | oo {{ 16, 128, 16, 128}}
#define | sat16(v) (((v) + 0x8000) & ~0xffff ? ((v) >> 31) ^ 0x7fff : v)

## Functions
static void | tdaan_video_resize (post_plugin_tdaan_t *this)
static void | tdaan_draw_text (vo_frame_t *frame, int x, int y, const char *s)
static void | tdaan_draw_line (vo_frame_t *frame, int x1, int y1, int x2, int y2, uint32_t gray)
static void | tdaan_draw_rect (vo_frame_t *frame, int x, int y, int width, int height, uint32_t color)
static void | tdaan_levels_draw (post_plugin_tdaan_t *this, vo_frame_t *frame)
static int | tdaan_int16todb (int s)
static int | tdaan_int32todb (uint32_t s)
static void | tdaan_levels_reset (post_plugin_tdaan_t *this)
static void | tdaan_levels_get (tdaan_leveller_t *v, const int16_t *data, int len)
static uint32_t | tdaan_divu_quad_by_short (uint64_t num, uint32_t den)
static void | tdaan_levels_done (post_plugin_tdaan_t *this)
static void | tdaan_phaser_start (post_plugin_tdaan_t *this, vo_frame_t *frame)
static void | tdaan_phaser_draw (post_plugin_tdaan_t *this, vo_frame_t *frame, const uint16_t *data, int len, uint32_t gray)
static void | tdaan_downmix16_4 (const int16_t *p, int16_t *q, int n)
static void | tdaan_downmix16_6 (const int16_t *p, int16_t *q, int n)
static int | tdaan_rewire_video (xine_post_out_t *output_gen, void *data)
static int | tdaan_port_open (xine_audio_port_t *port_gen, xine_stream_t *stream, uint32_t bits, uint32_t rate, int mode)
static void | tdaan_port_close (xine_audio_port_t *port_gen, xine_stream_t *stream)
static void | tdaan_port_put_buffer (xine_audio_port_t *port_gen, audio_buffer_t *buf, xine_stream_t *stream)
static void | tdaan_dispose (post_plugin_t *this_gen)
static post_plugin_t * | tdaan_open_plugin (post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target)
void * | tdaan_init_plugin (xine_t *xine, const void *data)

## Variables
static const yuy2_color_t | tdaan_BLACK = {{ 16, 128, 16, 128}}
static const yuy2_color_t | tdaan_DARK_RED = {{ 83, 107, 83, 190}}
static const yuy2_color_t | tdaan_DARK_GREEN = {{124, 87, 124, 76}}
static const yuy2_color_t | tdaan_DARK_YELLOW = {{155, 66, 155, 138}}
static const yuy2_color_t | tdaan_GREY = {{128, 128, 128, 128}}
static const yuy2_color_t | tdaan_LIGHT_GRAY = {{170, 128, 170, 128}}
static const yuy2_color_t | tdaan_RED = {{103, 101, 103, 209}}
static const yuy2_color_t | tdaan_GREEN = {{148, 74, 148, 60}}
static const yuy2_color_t | tdaan_YELLOW = {{195, 47, 195, 141}}
static const yuy2_color_t | tdaan_WHITE = {{220, 128, 220, 128}}

## Macro Definition Documentation

## ◆ __ [1/2]

#define __ 255

## ◆ __ [2/2]

#define __ {{128, 128, 128, 128}}

## ◆ _o

#define _o {{128, 128, 16, 128}}

## ◆ o_

#define o_ {{ 16, 128, 128, 128}}

## ◆ oo

#define oo {{ 16, 128, 16, 128}}

## ◆ RING_LOG2

#define RING_LOG2 13

## ◆ RING_MASK

#define RING_MASK (RING_SIZE - 1)

## ◆ RING_SIZE

#define RING_SIZE (1 << RING_LOG2)

## ◆ sat16

#define sat16 | ( |  | v | ) | (((v) + 0x8000) & ~0xffff ? ((v) >> 31) ^ 0x7fff : v)

## Function Documentation

## ◆ tdaan_dispose()

static void tdaan_dispose | ( | post_plugin_t * | this_gen | ) |
| static

References _x_post_dispose().

Referenced by tdaan_open_plugin().

## ◆ tdaan_divu_quad_by_short()

static uint32_t tdaan_divu_quad_by_short | ( | uint64_t | num,
|  | uint32_t | den
| ) |  |
| static

Referenced by tdaan_levels_done().

## ◆ tdaan_downmix16_4()

static void tdaan_downmix16_4 | ( | const int16_t * | p,
|  | int16_t * | q,
|  | int | n
| ) |  |
| static

References sat16, and v.

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_downmix16_6()

static void tdaan_downmix16_6 | ( | const int16_t * | p,
|  | int16_t * | q,
|  | int | n
| ) |  |
| static

References sat16.

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_draw_line()

static void tdaan_draw_line | ( | vo_frame_t * | frame,
|  | int | x1,
|  | int | y1,
|  | int | x2,
|  | int | y2,
|  | uint32_t | gray
| ) |  |
| static

References vo_frame_s::base, and vo_frame_s::pitches.

Referenced by tdaan_phaser_draw(), and tdaan_phaser_start().

## ◆ tdaan_draw_rect()

static void tdaan_draw_rect | ( | vo_frame_t * | frame,
|  | int | x,
|  | int | y,
|  | int | width,
|  | int | height,
|  | uint32_t | color
| ) |  |
| static

References vo_frame_s::base, vo_frame_s::height, height, vo_frame_s::pitches, vo_frame_s::width, and width.

Referenced by tdaan_levels_draw(), and tdaan_port_put_buffer().

## ◆ tdaan_draw_text()

static void tdaan_draw_text | ( | vo_frame_t * | frame,
|  | int | x,
|  | int | y,
|  | const char * | s
| ) |  |
| static

References __, _o, vo_frame_s::base, o_, oo, vo_frame_s::pitches, yuy2_color_t::word, and z.

Referenced by tdaan_levels_draw(), and tdaan_phaser_start().

## ◆ tdaan_init_plugin()

void * tdaan_init_plugin | ( | xine_t * | xine,
|  | const void * | data
| ) |  |

References N_, NULL, post_class_s::open_plugin, and tdaan_open_plugin().

## ◆ tdaan_int16todb()

static int tdaan_int16todb | ( | int | s | ) |
| static

Referenced by tdaan_levels_done().

## ◆ tdaan_int32todb()

static int tdaan_int32todb | ( | uint32_t | s | ) |
| static

Referenced by tdaan_levels_done().

## ◆ tdaan_levels_done()

static void tdaan_levels_done | ( | post_plugin_tdaan_t * | this | ) |
| static

References tdaan_divu_quad_by_short(), tdaan_int16todb(), and tdaan_int32todb().

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_levels_draw()

static void tdaan_levels_draw | ( | post_plugin_tdaan_t * | this,
|  | vo_frame_t * | frame
| ) |  |
| static

References vo_frame_s::height, tdaan_BLACK, tdaan_DARK_GREEN, tdaan_DARK_RED, tdaan_DARK_YELLOW, tdaan_draw_rect(), tdaan_draw_text(), tdaan_GREEN, tdaan_RED, tdaan_YELLOW, vo_frame_s::width, and yuy2_color_t::word.

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_levels_get()

static void tdaan_levels_get | ( | tdaan_leveller_t * | v,
|  | const int16_t * | data,
|  | int | len
| ) |  |
| static

References v.

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_levels_reset()

static void tdaan_levels_reset | ( | post_plugin_tdaan_t * | this | ) |
| static

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_open_plugin()

static post_plugin_t * tdaan_open_plugin | ( | post_class_t * | class_gen,
|  | int | inputs,
|  | xine_audio_port_t ** | audio_target,
|  | xine_video_port_t ** | video_target
| ) |  |
| static

References _x_post_init(), _x_post_intercept_audio_port(), xine_audio_port_s::close, xine_post_out_s::data, input(), xine_post_out_s::name, post_audio_port_s::new_port, NULL, xine_audio_port_s::open, post_out_s::post, xine_audio_port_s::put_buffer, xine_post_out_s::rewire, tdaan_dispose(), tdaan_port_close(), tdaan_port_open(), tdaan_port_put_buffer(), tdaan_rewire_video(), xine_post_out_s::type, xine_list_push_back(), post_out_s::xine_out, and XINE_POST_DATA_VIDEO.

Referenced by tdaan_init_plugin().

## ◆ tdaan_phaser_draw()

static void tdaan_phaser_draw | ( | post_plugin_tdaan_t * | this,
|  | vo_frame_t * | frame,
|  | const uint16_t * | data,
|  | int | len,
|  | uint32_t | gray
| ) |  |
| static

References tdaan_draw_line().

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_phaser_start()

static void tdaan_phaser_start | ( | post_plugin_tdaan_t * | this,
|  | vo_frame_t * | frame
| ) |  |
| static

References yuy2_color_t::bytes, tdaan_BLACK, tdaan_draw_line(), and tdaan_draw_text().

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_port_close()

static void tdaan_port_close | ( | xine_audio_port_t * | port_gen,
|  | xine_stream_t * | stream
| ) |  |
| static

References _x_post_dec_usage, xine_audio_port_s::close, NULL, post_audio_port_s::original_port, post_audio_port_s::post, post_audio_port_s::stream, and XINE_ANON_STREAM.

Referenced by tdaan_open_plugin().

## ◆ tdaan_port_open()

static int tdaan_port_open | ( | xine_audio_port_t * | port_gen,
|  | xine_stream_t * | stream,
|  | uint32_t | bits,
|  | uint32_t | rate,
|  | int | mode
| ) |  |
| static

References _x_ao_mode2channels(), _x_metronom_init(), _x_post_inc_usage, _x_post_rewire(), post_audio_port_s::bits, bits, xine_stream_s::metronom, post_audio_port_s::mode, mode(), xine_audio_port_s::open, post_audio_port_s::original_port, post_audio_port_s::post, post_audio_port_s::rate, post_audio_port_s::stream, tdaan_video_resize(), xine_stream_s::xine, and XINE_ANON_STREAM.

Referenced by tdaan_open_plugin().

## ◆ tdaan_port_put_buffer()

static void tdaan_port_put_buffer | ( | xine_audio_port_t * | port_gen,
|  | audio_buffer_t * | buf,
|  | xine_stream_t * | stream
| ) |  |
| static

References post_audio_port_s::bits, yuy2_color_t::bytes, vo_frame_s::draw, vo_frame_s::duration, vo_frame_s::extra_info, vo_frame_s::free, vo_frame_s::height, extra_info_s::invalid, audio_buffer_s::mem, audio_buffer_s::num_frames, post_audio_port_s::original_port, post_audio_port_s::post, vo_frame_s::pts, put, xine_audio_port_s::put_buffer, post_audio_port_s::rate, RING_MASK, RING_SIZE, tdaan_downmix16_4(), tdaan_downmix16_6(), tdaan_draw_rect(), tdaan_GREY, tdaan_levels_done(), tdaan_levels_draw(), tdaan_levels_get(), tdaan_levels_reset(), tdaan_LIGHT_GRAY, tdaan_phaser_draw(), tdaan_phaser_start(), tdaan_WHITE, VO_BOTH_FIELDS, audio_buffer_s::vpts, vo_frame_s::width, yuy2_color_t::word, XINE_ANON_STREAM, and XINE_IMGFMT_YUY2.

Referenced by tdaan_open_plugin().

## ◆ tdaan_rewire_video()

static int tdaan_rewire_video | ( | xine_post_out_t * | output_gen,
|  | void * | data
| ) |  |
| static

References xine_video_port_s::close, xine_post_out_s::data, post_out_s::post, and XINE_ANON_STREAM.

Referenced by tdaan_open_plugin().

## ◆ tdaan_video_resize()

static void tdaan_video_resize | ( | post_plugin_tdaan_t * | this | ) |
| static

Referenced by tdaan_port_open().

## Variable Documentation

## ◆ tdaan_BLACK

const yuy2_color_t tdaan_BLACK = {{ 16, 128, 16, 128}}
| static

Referenced by tdaan_levels_draw(), and tdaan_phaser_start().

## ◆ tdaan_DARK_GREEN

const yuy2_color_t tdaan_DARK_GREEN = {{124, 87, 124, 76}}
| static

Referenced by tdaan_levels_draw().

## ◆ tdaan_DARK_RED

const yuy2_color_t tdaan_DARK_RED = {{ 83, 107, 83, 190}}
| static

Referenced by tdaan_levels_draw().

## ◆ tdaan_DARK_YELLOW

const yuy2_color_t tdaan_DARK_YELLOW = {{155, 66, 155, 138}}
| static

Referenced by tdaan_levels_draw().

## ◆ tdaan_GREEN

const yuy2_color_t tdaan_GREEN = {{148, 74, 148, 60}}
| static

Referenced by tdaan_levels_draw().

## ◆ tdaan_GREY

const yuy2_color_t tdaan_GREY = {{128, 128, 128, 128}}
| static

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_LIGHT_GRAY

const yuy2_color_t tdaan_LIGHT_GRAY = {{170, 128, 170, 128}}
| static

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_RED

const yuy2_color_t tdaan_RED = {{103, 101, 103, 209}}
| static

Referenced by tdaan_levels_draw().

## ◆ tdaan_WHITE

const yuy2_color_t tdaan_WHITE = {{220, 128, 220, 128}}
| static

Referenced by tdaan_port_put_buffer().

## ◆ tdaan_YELLOW

const yuy2_color_t tdaan_YELLOW = {{195, 47, 195, 141}}
| static

Referenced by tdaan_levels_draw().