[vlc-devel] [PATCH 08/17] Audio Filter : Audio frames are now vlc_frame_t
Denis Charmet
typx at dinauz.org
Mon Apr 22 19:10:37 CEST 2019
---
modules/arm_neon/volume.c | 8 +-
modules/audio_filter/audiobargraph_a.c | 4 +-
modules/audio_filter/channel_mixer/dolby.c | 8 +-
.../audio_filter/channel_mixer/headphone.c | 32 +++---
modules/audio_filter/channel_mixer/mono.c | 42 ++++----
modules/audio_filter/channel_mixer/remap.c | 32 +++---
modules/audio_filter/channel_mixer/simple.c | 68 ++++++-------
.../audio_filter/channel_mixer/simple_neon.h | 6 +-
.../channel_mixer/spatialaudio.cpp | 8 +-
modules/audio_filter/channel_mixer/trivial.c | 20 ++--
modules/audio_filter/chorus_flanger.c | 4 +-
modules/audio_filter/compressor.c | 4 +-
modules/audio_filter/converter/format.c | 97 +++++++++----------
modules/audio_filter/converter/tospdif.c | 30 +++---
modules/audio_filter/equalizer.c | 4 +-
modules/audio_filter/gain.c | 8 +-
modules/audio_filter/karaoke.c | 10 +-
modules/audio_filter/normvol.c | 6 +-
modules/audio_filter/param_eq.c | 4 +-
modules/audio_filter/resampler/bandlimited.c | 34 +++----
modules/audio_filter/resampler/soxr.c | 32 +++---
modules/audio_filter/resampler/speex.c | 10 +-
modules/audio_filter/resampler/src.c | 12 +--
modules/audio_filter/resampler/ugly.c | 10 +-
modules/audio_filter/scaletempo.c | 16 +--
.../audio_filter/spatializer/spatializer.cpp | 4 +-
modules/audio_filter/stereo_widen.c | 10 +-
27 files changed, 261 insertions(+), 262 deletions(-)
diff --git a/modules/arm_neon/volume.c b/modules/arm_neon/volume.c
index 3497387032..01251e06ae 100644
--- a/modules/arm_neon/volume.c
+++ b/modules/arm_neon/volume.c
@@ -40,7 +40,7 @@ vlc_module_begin()
set_callbacks(Probe, NULL)
vlc_module_end()
-static void AmplifyFloat(audio_volume_t *, block_t *, float);
+static void AmplifyFloat(audio_volume_t *, vlc_frame_t *, float);
static int Probe(vlc_object_t *obj)
{
@@ -57,10 +57,10 @@ static int Probe(vlc_object_t *obj)
void amplify_float_arm_neon(float *, const float *, size_t, float) asm("amplify_float_arm_neon");
-static void AmplifyFloat(audio_volume_t *volume, block_t *block, float amp)
+static void AmplifyFloat(audio_volume_t *volume, vlc_frame_t *frame, float amp)
{
- float *buf = (float *)block->p_buffer;
- size_t length = block->i_buffer;
+ float *buf = (float *)frame->p_buffer;
+ size_t length = frame->i_buffer;
if (amp == 1.0)
return;
diff --git a/modules/audio_filter/audiobargraph_a.c b/modules/audio_filter/audiobargraph_a.c
index e744b52f24..cf4735c9fb 100644
--- a/modules/audio_filter/audiobargraph_a.c
+++ b/modules/audio_filter/audiobargraph_a.c
@@ -63,7 +63,7 @@
*****************************************************************************/
static int Open( vlc_object_t * );
static void Close( vlc_object_t * );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
vlc_module_begin ()
set_description( N_("Audio part of the BarGraph function") )
@@ -166,7 +166,7 @@ static void SendValues(filter_t *p_filter, float *value, int nbChannels)
/*****************************************************************************
* DoWork: treat an audio buffer
****************************************************************************/
-static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *DoWork( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
float *p_sample = (float *)p_in_buf->p_buffer;
diff --git a/modules/audio_filter/channel_mixer/dolby.c b/modules/audio_filter/channel_mixer/dolby.c
index 8d5c63c256..8c575eacbc 100644
--- a/modules/audio_filter/channel_mixer/dolby.c
+++ b/modules/audio_filter/channel_mixer/dolby.c
@@ -39,7 +39,7 @@
static int Create ( vlc_object_t * );
static void Destroy ( vlc_object_t * );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
/*****************************************************************************
* Module descriptor
@@ -155,7 +155,7 @@ static void Destroy( vlc_object_t *p_this )
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
-static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
filter_sys_t * p_sys = p_filter->p_sys;
float * p_in = (float*) p_in_buf->p_buffer;
@@ -163,7 +163,7 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
size_t i_nb_channels = aout_FormatNbChannels( &p_filter->fmt_out.audio );
size_t i_nb_rear = 0;
size_t i;
- block_t *p_out_buf = block_Alloc(
+ vlc_frame_t *p_out_buf = vlc_frame_Alloc(
sizeof(float) * i_nb_samples * i_nb_channels );
if( !p_out_buf )
goto out;
@@ -226,6 +226,6 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
}
}
out:
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
diff --git a/modules/audio_filter/channel_mixer/headphone.c b/modules/audio_filter/channel_mixer/headphone.c
index 0c91a15892..7d40f2cd8b 100644
--- a/modules/audio_filter/channel_mixer/headphone.c
+++ b/modules/audio_filter/channel_mixer/headphone.c
@@ -35,14 +35,14 @@
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int OpenFilter ( vlc_object_t * );
static void CloseFilter( vlc_object_t * );
-static block_t *Convert( filter_t *, block_t * );
+static vlc_frame_t *Convert( filter_t *, vlc_frame_t * );
/*****************************************************************************
* Module descriptor
@@ -329,7 +329,7 @@ static int Init( vlc_object_t *p_this, filter_sys_t * p_data
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( filter_t * p_filter,
- block_t * p_in_buf, block_t * p_out_buf )
+ vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
@@ -499,34 +499,34 @@ static void CloseFilter( vlc_object_t *p_this )
free( p_sys );
}
-static block_t *Convert( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Convert( filter_t *p_filter, vlc_frame_t *p_frame )
{
- if( !p_block || !p_block->i_nb_samples )
+ if( !p_frame || !p_frame->i_nb_samples )
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
return NULL;
}
- size_t i_out_size = p_block->i_buffer *
+ size_t i_out_size = p_frame->i_buffer *
aout_FormatNbChannels( &(p_filter->fmt_out.audio) ) /
aout_FormatNbChannels( &(p_filter->fmt_in.audio) );
- block_t *p_out = block_Alloc( i_out_size );
+ vlc_frame_t *p_out = vlc_frame_Alloc( i_out_size );
if( !p_out )
{
msg_Warn( p_filter, "can't get output buffer" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
- p_out->i_nb_samples = p_block->i_nb_samples;
- p_out->i_dts = p_block->i_dts;
- p_out->i_pts = p_block->i_pts;
- p_out->i_length = p_block->i_length;
+ p_out->i_nb_samples = p_frame->i_nb_samples;
+ p_out->i_dts = p_frame->i_dts;
+ p_out->i_pts = p_frame->i_pts;
+ p_out->i_length = p_frame->i_length;
- DoWork( p_filter, p_block, p_out );
+ DoWork( p_filter, p_frame, p_out );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return p_out;
}
diff --git a/modules/audio_filter/channel_mixer/mono.c b/modules/audio_filter/channel_mixer/mono.c
index 0c383e761e..0925caa33a 100644
--- a/modules/audio_filter/channel_mixer/mono.c
+++ b/modules/audio_filter/channel_mixer/mono.c
@@ -32,7 +32,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include <vlc_filter.h>
#include <vlc_aout.h>
@@ -42,11 +42,11 @@
static int OpenFilter ( vlc_object_t * );
static void CloseFilter ( vlc_object_t * );
-static block_t *Convert( filter_t *p_filter, block_t *p_block );
+static vlc_frame_t *Convert( filter_t *p_filter, vlc_frame_t *p_frame );
-static unsigned int stereo_to_mono( filter_t *, block_t *, block_t * );
-static unsigned int mono( filter_t *, block_t *, block_t * );
-static void stereo2mono_downmix( filter_t *, block_t *, block_t * );
+static unsigned int stereo_to_mono( filter_t *, vlc_frame_t *, vlc_frame_t * );
+static unsigned int mono( filter_t *, vlc_frame_t *, vlc_frame_t * );
+static void stereo2mono_downmix( filter_t *, vlc_frame_t *, vlc_frame_t * );
/*****************************************************************************
* Local structures
@@ -418,31 +418,31 @@ static void CloseFilter( vlc_object_t *p_this)
/*****************************************************************************
* Convert
*****************************************************************************/
-static block_t *Convert( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Convert( filter_t *p_filter, vlc_frame_t *p_frame )
{
- block_t *p_out;
+ vlc_frame_t *p_out;
int i_out_size;
- if( !p_block || !p_block->i_nb_samples )
+ if( !p_frame || !p_frame->i_nb_samples )
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
return NULL;
}
filter_sys_t *p_sys = p_filter->p_sys;
- i_out_size = p_block->i_nb_samples * p_sys->i_bitspersample/8 *
+ i_out_size = p_frame->i_nb_samples * p_sys->i_bitspersample/8 *
aout_FormatNbChannels( &(p_filter->fmt_out.audio) );
- p_out = block_Alloc( i_out_size );
+ p_out = vlc_frame_Alloc( i_out_size );
if( !p_out )
{
msg_Warn( p_filter, "can't get output buffer" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
p_out->i_nb_samples =
- (p_block->i_nb_samples / p_sys->i_nb_channels) *
+ (p_frame->i_nb_samples / p_sys->i_nb_channels) *
aout_FormatNbChannels( &(p_filter->fmt_out.audio) );
#if 0
@@ -458,15 +458,15 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
memset( p_out->p_buffer, 0, i_out_size );
if( p_sys->b_downmix )
{
- stereo2mono_downmix( p_filter, p_block, p_out );
- mono( p_filter, p_out, p_block );
+ stereo2mono_downmix( p_filter, p_frame, p_out );
+ mono( p_filter, p_out, p_frame );
}
else
{
- stereo_to_mono( p_filter, p_out, p_block );
+ stereo_to_mono( p_filter, p_out, p_frame );
}
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return p_out;
}
@@ -476,7 +476,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
* Written by Boris Dorès <babal at via.ecp.fr>
*/
static void stereo2mono_downmix( filter_t * p_filter,
- block_t * p_in_buf, block_t * p_out_buf )
+ vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
@@ -579,7 +579,7 @@ static void stereo2mono_downmix( filter_t * p_filter,
/* Simple stereo to mono mixing. */
static unsigned int mono( filter_t *p_filter,
- block_t *p_output, block_t *p_input )
+ vlc_frame_t *p_output, vlc_frame_t *p_input )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int16_t *p_in, *p_out;
@@ -599,7 +599,7 @@ static unsigned int mono( filter_t *p_filter,
/* Simple stereo to mono mixing. */
static unsigned int stereo_to_mono( filter_t *p_filter,
- block_t *p_output, block_t *p_input )
+ vlc_frame_t *p_output, vlc_frame_t *p_input )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
int16_t *p_in, *p_out;
diff --git a/modules/audio_filter/channel_mixer/remap.c b/modules/audio_filter/channel_mixer/remap.c
index b3d284a582..aa1d68fd8a 100644
--- a/modules/audio_filter/channel_mixer/remap.c
+++ b/modules/audio_filter/channel_mixer/remap.c
@@ -31,7 +31,7 @@
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include <assert.h>
/*****************************************************************************
@@ -99,7 +99,7 @@ vlc_module_end ()
* Local prototypes
*****************************************************************************/
-static block_t *Remap( filter_t *, block_t * );
+static vlc_frame_t *Remap( filter_t *, vlc_frame_t * );
typedef void (*remap_fun_t)( filter_t *, const void *, void *,
int, unsigned, unsigned);
@@ -388,40 +388,40 @@ static void CloseFilter( vlc_object_t *p_this )
/*****************************************************************************
* Remap:
*****************************************************************************/
-static block_t *Remap( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Remap( filter_t *p_filter, vlc_frame_t *p_frame )
{
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
- if( !p_block || !p_block->i_nb_samples )
+ if( !p_frame || !p_frame->i_nb_samples )
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
return NULL;
}
- size_t i_out_size = p_block->i_nb_samples *
+ size_t i_out_size = p_frame->i_nb_samples *
p_filter->fmt_out.audio.i_bytes_per_frame;
- block_t *p_out = block_Alloc( i_out_size );
+ vlc_frame_t *p_out = vlc_frame_Alloc( i_out_size );
if( !p_out )
{
msg_Warn( p_filter, "can't get output buffer" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
- p_out->i_nb_samples = p_block->i_nb_samples;
- p_out->i_dts = p_block->i_dts;
- p_out->i_pts = p_block->i_pts;
- p_out->i_length = p_block->i_length;
+ p_out->i_nb_samples = p_frame->i_nb_samples;
+ p_out->i_dts = p_frame->i_dts;
+ p_out->i_pts = p_frame->i_pts;
+ p_out->i_length = p_frame->i_length;
memset( p_out->p_buffer, 0, i_out_size );
p_sys->pf_remap( p_filter,
- (const void *)p_block->p_buffer, (void *)p_out->p_buffer,
- p_block->i_nb_samples,
+ (const void *)p_frame->p_buffer, (void *)p_out->p_buffer,
+ p_frame->i_nb_samples,
p_filter->fmt_in.audio.i_channels,
p_filter->fmt_out.audio.i_channels );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return p_out;
}
diff --git a/modules/audio_filter/channel_mixer/simple.c b/modules/audio_filter/channel_mixer/simple.c
index 8b3feb7a31..43561ecaaa 100644
--- a/modules/audio_filter/channel_mixer/simple.c
+++ b/modules/audio_filter/channel_mixer/simple.c
@@ -31,7 +31,7 @@
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
/*****************************************************************************
* Module descriptor
@@ -46,9 +46,9 @@ vlc_module_begin ()
set_callbacks( OpenFilter, NULL );
vlc_module_end ()
-static block_t *Filter( filter_t *, block_t * );
+static vlc_frame_t *Filter( filter_t *, vlc_frame_t * );
-static void DoWork_7_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_7_x_to_2_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -63,8 +63,8 @@ static void DoWork_7_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_6_1_to_2_0( filter_t *p_filter, block_t *p_in_buf,
- block_t *p_out_buf )
+static void DoWork_6_1_to_2_0( filter_t *p_filter, vlc_frame_t *p_in_buf,
+ vlc_frame_t *p_out_buf )
{
VLC_UNUSED(p_filter);
float *p_dest = (float *)p_out_buf->p_buffer;
@@ -82,7 +82,7 @@ static void DoWork_6_1_to_2_0( filter_t *p_filter, block_t *p_in_buf,
}
}
-static void DoWork_5_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_5_x_to_2_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -96,7 +96,7 @@ static void DoWork_5_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_4_0_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_4_0_to_2_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
VLC_UNUSED(p_filter);
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
@@ -108,7 +108,7 @@ static void DoWork_4_0_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_3_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_3_x_to_2_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -122,7 +122,7 @@ static void DoWork_3_x_to_2_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_7_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_7_x_to_1_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -135,7 +135,7 @@ static void DoWork_7_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_5_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_5_x_to_1_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -149,7 +149,7 @@ static void DoWork_5_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_4_0_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_4_0_to_1_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
VLC_UNUSED(p_filter);
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
@@ -160,7 +160,7 @@ static void DoWork_4_0_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_3_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_3_x_to_1_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -173,7 +173,7 @@ static void DoWork_3_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_2_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_2_x_to_1_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
VLC_UNUSED(p_filter);
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
@@ -185,7 +185,7 @@ static void DoWork_2_x_to_1_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_7_x_to_4_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_7_x_to_4_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -201,7 +201,7 @@ static void DoWork_7_x_to_4_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_5_x_to_4_0( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_5_x_to_4_0( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -218,7 +218,7 @@ static void DoWork_5_x_to_4_0( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_7_x_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_7_x_to_5_x( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
for( int i = p_in_buf->i_nb_samples; i--; )
@@ -238,7 +238,7 @@ static void DoWork_7_x_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t
}
}
-static void DoWork_6_1_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t * p_out_buf ) {
+static void DoWork_6_1_to_5_x( filter_t * p_filter, vlc_frame_t * p_in_buf, vlc_frame_t * p_out_buf ) {
VLC_UNUSED(p_filter);
float *p_dest = (float *)p_out_buf->p_buffer;
const float *p_src = (const float *)p_in_buf->p_buffer;
@@ -270,7 +270,7 @@ static void DoWork_6_1_to_5_x( filter_t * p_filter, block_t * p_in_buf, block_t
static int OpenFilter( vlc_object_t *p_this )
{
filter_t *p_filter = (filter_t *)p_this;
- void (*do_work)(filter_t *, block_t *, block_t *) = NULL;
+ void (*do_work)(filter_t *, vlc_frame_t *, vlc_frame_t *) = NULL;
if( p_filter->fmt_in.audio.i_format != VLC_CODEC_FL32 ||
p_filter->fmt_in.audio.i_format != p_filter->fmt_out.audio.i_format ||
@@ -353,42 +353,42 @@ static int OpenFilter( vlc_object_t *p_this )
/*****************************************************************************
* Filter:
*****************************************************************************/
-static block_t *Filter( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Filter( filter_t *p_filter, vlc_frame_t *p_frame )
{
- void (*work)(filter_t *, block_t *, block_t *) = (void *)p_filter->p_sys;
+ void (*work)(filter_t *, vlc_frame_t *, vlc_frame_t *) = (void *)p_filter->p_sys;
- if( !p_block || !p_block->i_nb_samples )
+ if( !p_frame || !p_frame->i_nb_samples )
{
- if( p_block )
- block_Release( p_block );
+ if( p_frame )
+ vlc_frame_Release( p_frame );
return NULL;
}
- size_t i_out_size = p_block->i_nb_samples *
+ size_t i_out_size = p_frame->i_nb_samples *
p_filter->fmt_out.audio.i_bitspersample *
p_filter->fmt_out.audio.i_channels / 8;
- block_t *p_out = block_Alloc( i_out_size );
+ vlc_frame_t *p_out = vlc_frame_Alloc( i_out_size );
if( !p_out )
{
msg_Warn( p_filter, "can't get output buffer" );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return NULL;
}
- p_out->i_nb_samples = p_block->i_nb_samples;
- p_out->i_dts = p_block->i_dts;
- p_out->i_pts = p_block->i_pts;
- p_out->i_length = p_block->i_length;
+ p_out->i_nb_samples = p_frame->i_nb_samples;
+ p_out->i_dts = p_frame->i_dts;
+ p_out->i_pts = p_frame->i_pts;
+ p_out->i_length = p_frame->i_length;
int i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
int i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
- p_out->i_nb_samples = p_block->i_nb_samples;
- p_out->i_buffer = p_block->i_buffer * i_output_nb / i_input_nb;
+ p_out->i_nb_samples = p_frame->i_nb_samples;
+ p_out->i_buffer = p_frame->i_buffer * i_output_nb / i_input_nb;
- work( p_filter, p_block, p_out );
+ work( p_filter, p_frame, p_out );
- block_Release( p_block );
+ vlc_frame_Release( p_frame );
return p_out;
}
diff --git a/modules/audio_filter/channel_mixer/simple_neon.h b/modules/audio_filter/channel_mixer/simple_neon.h
index 4a2fcd0ff7..fc22ad6050 100644
--- a/modules/audio_filter/channel_mixer/simple_neon.h
+++ b/modules/audio_filter/channel_mixer/simple_neon.h
@@ -34,14 +34,14 @@
#define NEON_WRAPPER(in, out) \
void convert_##in##_to_##out##_neon_asm(float *dst, const float *src, int num, bool lfeChannel); \
- static inline void DoWork_##in##_to_##out##_neon( filter_t *p_filter, block_t *p_in_buf, block_t *p_out_buf ) \
+ static inline void DoWork_##in##_to_##out##_neon( filter_t *p_filter, vlc_frame_t *p_in_buf, vlc_frame_t *p_out_buf ) \
{ \
const float *p_src = (const float *)p_in_buf->p_buffer; \
float *p_dest = (float *)p_out_buf->p_buffer; \
convert_##in##_to_##out##_neon_asm( p_dest, p_src, p_in_buf->i_nb_samples, \
p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ); \
} \
- static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, block_t*, block_t*) \
+ static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, vlc_frame_t*, vlc_frame_t*) \
{ \
return vlc_CPU_ARM_NEON() ? DoWork_##in##_to_##out##_neon : DoWork_##in##_to_##out; \
}
@@ -58,7 +58,7 @@ NEON_WRAPPER(5_x,4_0)
/* TODO: the following conversions are not handled in NEON */
#define C_WRAPPER(in, out) \
- static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, block_t*, block_t*) \
+ static inline void (*GET_WORK_##in##_to_##out##_neon())(filter_t*, vlc_frame_t*, vlc_frame_t*) \
{ \
return DoWork_##in##_to_##out; \
}
diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp
index 755f1422d5..39feca8dfa 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -164,7 +164,7 @@ static std::string getHRTFPath(filter_t *p_filter)
return HRTFPath;
}
-static block_t *Mix( filter_t *p_filter, block_t *p_buf )
+static vlc_frame_t *Mix( filter_t *p_filter, vlc_frame_t *p_buf )
{
filter_spatialaudio *p_sys = reinterpret_cast<filter_spatialaudio *>(p_filter->p_sys);
@@ -183,10 +183,10 @@ static block_t *Mix( filter_t *p_filter, block_t *p_buf )
const size_t i_outputBlockSize = sizeof(float) * p_sys->i_outputNb * AMB_BLOCK_TIME_LEN;
const size_t i_nbBlocks = p_sys->inputSamples.size() * sizeof(float) / i_inputBlockSize;
- block_t *p_out_buf = block_Alloc(i_outputBlockSize * i_nbBlocks);
+ vlc_frame_t *p_out_buf = vlc_frame_Alloc(i_outputBlockSize * i_nbBlocks);
if (unlikely(p_out_buf == NULL))
{
- block_Release(p_buf);
+ vlc_frame_Release(p_buf);
return NULL;
}
@@ -273,7 +273,7 @@ static block_t *Mix( filter_t *p_filter, block_t *p_buf )
p_sys->i_inputPTS = p_out_buf->i_pts + p_out_buf->i_length;
- block_Release(p_buf);
+ vlc_frame_Release(p_buf);
return p_out_buf;
}
diff --git a/modules/audio_filter/channel_mixer/trivial.c b/modules/audio_filter/channel_mixer/trivial.c
index 6b5b843c87..78fc53a184 100644
--- a/modules/audio_filter/channel_mixer/trivial.c
+++ b/modules/audio_filter/channel_mixer/trivial.c
@@ -54,18 +54,18 @@ typedef struct
/**
* Trivially upmixes
*/
-static block_t *Upmix( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *Upmix( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
unsigned i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
unsigned i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
assert( i_input_nb < i_output_nb );
- block_t *p_out_buf = block_Alloc(
+ vlc_frame_t *p_out_buf = vlc_frame_Alloc(
p_in_buf->i_buffer * i_output_nb / i_input_nb );
if( unlikely(p_out_buf == NULL) )
{
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
@@ -89,14 +89,14 @@ static block_t *Upmix( filter_t *p_filter, block_t *p_in_buf )
p_dest += i_output_nb;
}
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
/**
* Trivially downmixes (i.e. drop extra channels)
*/
-static block_t *Downmix( filter_t *p_filter, block_t *p_buf )
+static vlc_frame_t *Downmix( filter_t *p_filter, vlc_frame_t *p_buf )
{
unsigned i_input_nb = aout_FormatNbChannels( &p_filter->fmt_in.audio );
unsigned i_output_nb = aout_FormatNbChannels( &p_filter->fmt_out.audio );
@@ -125,23 +125,23 @@ static block_t *Downmix( filter_t *p_filter, block_t *p_buf )
return p_buf;
}
-static block_t *Equals( filter_t *p_filter, block_t *p_buf )
+static vlc_frame_t *Equals( filter_t *p_filter, vlc_frame_t *p_buf )
{
(void) p_filter;
return p_buf;
}
-static block_t *Extract( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *Extract( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
size_t i_out_channels = aout_FormatNbChannels( &p_filter->fmt_out.audio );
size_t i_out_size = p_in_buf->i_nb_samples
* p_filter->fmt_out.audio.i_bitspersample
* i_out_channels / 8;
- block_t *p_out_buf = block_Alloc( i_out_size );
+ vlc_frame_t *p_out_buf = vlc_frame_Alloc( i_out_size );
if( unlikely(p_out_buf == NULL) )
{
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
@@ -161,7 +161,7 @@ static block_t *Extract( filter_t *p_filter, block_t *p_in_buf )
p_in_buf->i_nb_samples, pi_selections,
p_filter->fmt_out.audio.i_bitspersample );
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
diff --git a/modules/audio_filter/chorus_flanger.c b/modules/audio_filter/chorus_flanger.c
index 8643c502f8..abda3856f1 100644
--- a/modules/audio_filter/chorus_flanger.c
+++ b/modules/audio_filter/chorus_flanger.c
@@ -41,7 +41,7 @@ typedef struct filter_sys_t filter_sys_t;
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
static int paramCallback( vlc_object_t *, char const *, vlc_value_t ,
vlc_value_t , void * );
static int reallocate_buffer( filter_t *, filter_sys_t * );
@@ -218,7 +218,7 @@ static inline void sanitize( float * f_value )
* @param p_in_buf Input buffer
* @return Output buffer
*/
-static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *DoWork( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
struct filter_sys_t *p_sys = p_filter->p_sys;
int i_chan;
diff --git a/modules/audio_filter/compressor.c b/modules/audio_filter/compressor.c
index 402cbb5ed1..27c3e57223 100644
--- a/modules/audio_filter/compressor.c
+++ b/modules/audio_filter/compressor.c
@@ -116,7 +116,7 @@ typedef union
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static block_t *DoWork ( filter_t *, block_t * );
+static vlc_frame_t *DoWork ( filter_t *, vlc_frame_t * );
static void DbInit ( filter_sys_t * );
static float Db2Lin ( float, filter_sys_t * );
@@ -293,7 +293,7 @@ static void Close( vlc_object_t *p_this )
* DoWork: process samples buffer
*****************************************************************************/
-static block_t * DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t * DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
int i_samples = p_in_buf->i_nb_samples;
int i_channels = aout_FormatNbChannels( &p_filter->fmt_in.audio );
diff --git a/modules/audio_filter/converter/format.c b/modules/audio_filter/converter/format.c
index 2178668b31..c21851e281 100644
--- a/modules/audio_filter/converter/format.c
+++ b/modules/audio_filter/converter/format.c
@@ -36,7 +36,6 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
-#include <vlc_block.h>
#include <vlc_filter.h>
/*****************************************************************************
@@ -56,7 +55,7 @@ vlc_module_end()
* Local prototypes
*****************************************************************************/
-typedef block_t *(*cvt_t)(filter_t *, block_t *);
+typedef vlc_frame_t *(*cvt_t)(filter_t *, vlc_frame_t *);
static cvt_t FindConversion(vlc_fourcc_t src, vlc_fourcc_t dst);
static int Open(vlc_object_t *object)
@@ -83,77 +82,77 @@ static int Open(vlc_object_t *object)
/*** from U8 ***/
-static block_t *U8toS16(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *U8toS16(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
uint8_t *src = (uint8_t *)bsrc->p_buffer;
int16_t *dst = (int16_t *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer; i--;)
*dst++ = ((*src++) << 8) - 0x8000;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
-static block_t *U8toFl32(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *U8toFl32(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
uint8_t *src = (uint8_t *)bsrc->p_buffer;
float *dst = (float *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer; i--;)
*dst++ = ((float)((*src++) - 128)) / 128.f;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
-static block_t *U8toS32(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *U8toS32(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
uint8_t *src = (uint8_t *)bsrc->p_buffer;
int32_t *dst = (int32_t *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer; i--;)
*dst++ = ((*src++) << 24) - 0x80000000;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
-static block_t *U8toFl64(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *U8toFl64(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 8);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 8);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
uint8_t *src = (uint8_t *)bsrc->p_buffer;
double *dst = (double *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer; i--;)
*dst++ = ((double)((*src++) - 128)) / 128.;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
/*** from S16N ***/
-static block_t *S16toU8(filter_t *filter, block_t *b)
+static vlc_frame_t *S16toU8(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
int16_t *src = (int16_t *)b->p_buffer;
@@ -165,13 +164,13 @@ static block_t *S16toU8(filter_t *filter, block_t *b)
return b;
}
-static block_t *S16toFl32(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *S16toFl32(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
int16_t *src = (int16_t *)bsrc->p_buffer;
float *dst = (float *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer / 2; i--;)
@@ -188,48 +187,48 @@ static block_t *S16toFl32(filter_t *filter, block_t *bsrc)
}
#endif
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
-static block_t *S16toS32(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *S16toS32(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
int16_t *src = (int16_t *)bsrc->p_buffer;
int32_t *dst = (int32_t *)bdst->p_buffer;
for (int i = bsrc->i_buffer / 2; i--;)
*dst++ = *src++ << 16;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
-static block_t *S16toFl64(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *S16toFl64(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 4);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 4);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
int16_t *src = (int16_t *)bsrc->p_buffer;
float *dst = (float *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer / 2; i--;)
*dst++ = (double)*src++ / 32768.;
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
/*** from FL32 ***/
-static block_t *Fl32toU8(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl32toU8(filter_t *filter, vlc_frame_t *b)
{
float *src = (float *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
@@ -249,7 +248,7 @@ static block_t *Fl32toU8(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl32toS16(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl32toS16(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
float *src = (float *)b->p_buffer;
@@ -277,7 +276,7 @@ static block_t *Fl32toS16(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl32toS32(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl32toS32(filter_t *filter, vlc_frame_t *b)
{
float *src = (float *)b->p_buffer;
int32_t *dst = (int32_t *)src;
@@ -296,26 +295,26 @@ static block_t *Fl32toS32(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl32toFl64(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *Fl32toFl64(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
float *src = (float *)bsrc->p_buffer;
double *dst = (double *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer / 4; i--;)
*(dst++) = *(src++);
out:
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
VLC_UNUSED(filter);
return bdst;
}
/*** from S32N ***/
-static block_t *S32toU8(filter_t *filter, block_t *b)
+static vlc_frame_t *S32toU8(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
int32_t *src = (int32_t *)b->p_buffer;
@@ -327,7 +326,7 @@ static block_t *S32toU8(filter_t *filter, block_t *b)
return b;
}
-static block_t *S32toS16(filter_t *filter, block_t *b)
+static vlc_frame_t *S32toS16(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
int32_t *src = (int32_t *)b->p_buffer;
@@ -339,7 +338,7 @@ static block_t *S32toS16(filter_t *filter, block_t *b)
return b;
}
-static block_t *S32toFl32(filter_t *filter, block_t *b)
+static vlc_frame_t *S32toFl32(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
int32_t *src = (int32_t*)b->p_buffer;
@@ -349,26 +348,26 @@ static block_t *S32toFl32(filter_t *filter, block_t *b)
return b;
}
-static block_t *S32toFl64(filter_t *filter, block_t *bsrc)
+static vlc_frame_t *S32toFl64(filter_t *filter, vlc_frame_t *bsrc)
{
- block_t *bdst = block_Alloc(bsrc->i_buffer * 2);
+ vlc_frame_t *bdst = vlc_frame_Alloc(bsrc->i_buffer * 2);
if (unlikely(bdst == NULL))
goto out;
- block_CopyProperties(bdst, bsrc);
+ vlc_frame_CopyProperties(bdst, bsrc);
int32_t *src = (int32_t*)bsrc->p_buffer;
double *dst = (double *)bdst->p_buffer;
for (size_t i = bsrc->i_buffer / 4; i--;)
*dst++ = (double)(*src++) / 2147483648.;
out:
VLC_UNUSED(filter);
- block_Release(bsrc);
+ vlc_frame_Release(bsrc);
return bdst;
}
/*** from FL64 ***/
-static block_t *Fl64toU8(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl64toU8(filter_t *filter, vlc_frame_t *b)
{
double *src = (double *)b->p_buffer;
uint8_t *dst = (uint8_t *)src;
@@ -388,7 +387,7 @@ static block_t *Fl64toU8(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl64toS16(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl64toS16(filter_t *filter, vlc_frame_t *b)
{
VLC_UNUSED(filter);
double *src = (double *)b->p_buffer;
@@ -407,7 +406,7 @@ static block_t *Fl64toS16(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl64toFl32(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl64toFl32(filter_t *filter, vlc_frame_t *b)
{
double *src = (double *)b->p_buffer;
float *dst = (float *)src;
@@ -418,7 +417,7 @@ static block_t *Fl64toFl32(filter_t *filter, block_t *b)
return b;
}
-static block_t *Fl64toS32(filter_t *filter, block_t *b)
+static vlc_frame_t *Fl64toS32(filter_t *filter, vlc_frame_t *b)
{
double *src = (double *)b->p_buffer;
int32_t *dst = (int32_t *)src;
diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index c468af79d6..eeaaa92b3a 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -52,7 +52,7 @@ vlc_module_end ()
typedef struct
{
- block_t *p_out_buf;
+ vlc_frame_t *p_out_buf;
size_t i_out_offset;
union
@@ -86,7 +86,7 @@ typedef struct
#define SPDIF_SUCCESS VLC_SUCCESS
#define SPDIF_ERROR VLC_EGENERIC
-static bool is_big_endian( filter_t *p_filter, block_t *p_in_buf )
+static bool is_big_endian( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
switch( p_filter->fmt_in.audio.i_format )
{
@@ -162,7 +162,7 @@ static void write_data( filter_t *p_filter, const void *p_buf, size_t i_size,
}
}
-static void write_buffer( filter_t *p_filter, block_t *p_in_buf )
+static void write_buffer( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
write_data( p_filter, p_in_buf->p_buffer, p_in_buf->i_buffer,
@@ -170,7 +170,7 @@ static void write_buffer( filter_t *p_filter, block_t *p_in_buf )
p_sys->p_out_buf->i_length += p_in_buf->i_length;
}
-static int write_init( filter_t *p_filter, block_t *p_in_buf,
+static int write_init( filter_t *p_filter, vlc_frame_t *p_in_buf,
size_t i_out_size, unsigned i_nb_samples )
{
filter_sys_t *p_sys = p_filter->p_sys;
@@ -178,7 +178,7 @@ static int write_init( filter_t *p_filter, block_t *p_in_buf,
assert( p_sys->p_out_buf == NULL );
assert( i_out_size > SPDIF_HEADER_SIZE && ( i_out_size & 3 ) == 0 );
- p_sys->p_out_buf = block_Alloc( i_out_size );
+ p_sys->p_out_buf = vlc_frame_Alloc( i_out_size );
if( !p_sys->p_out_buf )
return VLC_ENOMEM;
p_sys->p_out_buf->i_dts = p_in_buf->i_dts;
@@ -214,7 +214,7 @@ static void write_finalize( filter_t *p_filter, uint16_t i_data_type,
p_sys->p_out_buf->i_buffer - p_sys->i_out_offset );
}
-static int write_buffer_ac3( filter_t *p_filter, block_t *p_in_buf )
+static int write_buffer_ac3( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
static const size_t a52_size = A52_FRAME_NB * 4;
@@ -244,11 +244,11 @@ static int write_buffer_ac3( filter_t *p_filter, block_t *p_in_buf )
}
-static int write_buffer_eac3( filter_t *p_filter, block_t *p_in_buf )
+static int write_buffer_eac3( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
- /* The input block can contain the following:
+ /* The input frame can contain the following:
* a/ One EAC3 independent stream (with 1, 2, 3 or 6 audio blocks per
* syncframe)
* b/ One AC3 stream followed by one EAC3 dependent stream (with 6 audio
@@ -314,7 +314,7 @@ static int write_buffer_eac3( filter_t *p_filter, block_t *p_in_buf )
* However, it seems it is not actually necessary for the 24 TrueHD frames to
* be in an exact alignment with the MAT frame
*/
-static int write_buffer_truehd( filter_t *p_filter, block_t *p_in_buf )
+static int write_buffer_truehd( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
#define TRUEHD_FRAME_OFFSET 2560
@@ -384,7 +384,7 @@ static int write_buffer_truehd( filter_t *p_filter, block_t *p_in_buf )
return SPDIF_MORE_DATA;
}
-static int write_buffer_dts( filter_t *p_filter, block_t *p_in_buf )
+static int write_buffer_dts( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
uint16_t i_data_type;
filter_sys_t *p_sys = p_filter->p_sys;
@@ -471,7 +471,7 @@ static int dtshd_get_subtype( unsigned i_frame_length )
}
/* Adapted from libavformat/spdifenc.c: */
-static int write_buffer_dtshd( filter_t *p_filter, block_t *p_in_buf )
+static int write_buffer_dtshd( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
static const char p_dtshd_start_code[10] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe
@@ -535,7 +535,7 @@ static void Flush( filter_t *p_filter )
if( p_sys->p_out_buf != NULL )
{
- block_Release( p_sys->p_out_buf );
+ vlc_frame_Release( p_sys->p_out_buf );
p_sys->p_out_buf = NULL;
}
switch( p_filter->fmt_in.audio.i_format )
@@ -551,10 +551,10 @@ static void Flush( filter_t *p_filter )
}
}
-static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *DoWork( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
- block_t *p_out_buf = NULL;
+ vlc_frame_t *p_out_buf = NULL;
int i_ret;
switch( p_filter->fmt_in.audio.i_format )
@@ -596,7 +596,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
break;
}
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
diff --git a/modules/audio_filter/equalizer.c b/modules/audio_filter/equalizer.c
index c63547f569..062b5370c9 100644
--- a/modules/audio_filter/equalizer.c
+++ b/modules/audio_filter/equalizer.c
@@ -124,7 +124,7 @@ typedef struct
vlc_mutex_t lock;
} filter_sys_t;
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
#define EQZ_IN_FACTOR (0.25f)
static int EqzInit( filter_t *, int );
@@ -188,7 +188,7 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************
*
*****************************************************************************/
-static block_t * DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t * DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
EqzFilter( p_filter, (float*)p_in_buf->p_buffer,
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
diff --git a/modules/audio_filter/gain.c b/modules/audio_filter/gain.c
index 655d944304..82afc43e9d 100644
--- a/modules/audio_filter/gain.c
+++ b/modules/audio_filter/gain.c
@@ -42,7 +42,7 @@
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static block_t *Process ( filter_t *, block_t * );
+static vlc_frame_t *Process ( filter_t *, vlc_frame_t * );
typedef struct
{
@@ -107,12 +107,12 @@ static int Open( vlc_object_t *p_this )
* Process: process samples buffer
*****************************************************************************/
-static block_t *Process( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Process( filter_t *p_filter, vlc_frame_t *p_frame )
{
filter_sys_t *p_sys = p_filter->p_sys;
- p_sys->volume.amplify( &p_sys->volume, p_block, p_sys->f_gain );
- return p_block;
+ p_sys->volume.amplify( &p_sys->volume, p_frame, p_sys->f_gain );
+ return p_frame;
}
diff --git a/modules/audio_filter/karaoke.c b/modules/audio_filter/karaoke.c
index cd89e1c5e6..4eb2c8d189 100644
--- a/modules/audio_filter/karaoke.c
+++ b/modules/audio_filter/karaoke.c
@@ -39,7 +39,7 @@ vlc_module_begin ()
set_callbacks (Open, NULL)
vlc_module_end ()
-static block_t *Process (filter_t *, block_t *);
+static vlc_frame_t *Process (filter_t *, vlc_frame_t *);
static int Open (vlc_object_t *obj)
{
@@ -58,12 +58,12 @@ static int Open (vlc_object_t *obj)
return VLC_SUCCESS;
}
-static block_t *Process (filter_t *filter, block_t *block)
+static vlc_frame_t *Process (filter_t *filter, vlc_frame_t *frame)
{
const float factor = .70710678 /* 1. / sqrtf (2) */;
- float *spl = (float *)block->p_buffer;
+ float *spl = (float *)frame->p_buffer;
- for (unsigned i = block->i_nb_samples; i > 0; i--)
+ for (unsigned i = frame->i_nb_samples; i > 0; i--)
{
float s = (spl[0] - spl[1]) * factor;
@@ -72,5 +72,5 @@ static block_t *Process (filter_t *filter, block_t *block)
/* TODO: set output format to mono */
}
(void) filter;
- return block;
+ return frame;
}
diff --git a/modules/audio_filter/normvol.c b/modules/audio_filter/normvol.c
index a9aa2b9cfb..888dc9b97d 100644
--- a/modules/audio_filter/normvol.c
+++ b/modules/audio_filter/normvol.c
@@ -49,7 +49,7 @@
static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
typedef struct
{
@@ -127,7 +127,7 @@ static int Open( vlc_object_t *p_this )
/*****************************************************************************
* DoWork : normalizes and sends a buffer
*****************************************************************************/
-static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
+static vlc_frame_t *DoWork( filter_t *p_filter, vlc_frame_t *p_in_buf )
{
float *pf_sum;
float *pf_gain;
@@ -215,7 +215,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
return p_in_buf;
out:
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
diff --git a/modules/audio_filter/param_eq.c b/modules/audio_filter/param_eq.c
index f498ffe08f..157040164f 100644
--- a/modules/audio_filter/param_eq.c
+++ b/modules/audio_filter/param_eq.c
@@ -45,7 +45,7 @@ static void CalcPeakEQCoeffs( float, float, float, float, float * );
static void CalcShelfEQCoeffs( float, float, float, int, float, float * );
static void ProcessEQ( const float *, float *, float *, unsigned, unsigned,
const float *, unsigned );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
vlc_module_begin ()
set_description( N_("Parametric Equalizer") )
@@ -164,7 +164,7 @@ static void Close( vlc_object_t *p_this )
*****************************************************************************
*
*****************************************************************************/
-static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
filter_sys_t *p_sys = p_filter->p_sys;
ProcessEQ( (float*)p_in_buf->p_buffer, (float*)p_in_buf->p_buffer,
diff --git a/modules/audio_filter/resampler/bandlimited.c b/modules/audio_filter/resampler/bandlimited.c
index 2d544315af..3f84404e2c 100644
--- a/modules/audio_filter/resampler/bandlimited.c
+++ b/modules/audio_filter/resampler/bandlimited.c
@@ -40,7 +40,7 @@
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
-#include <vlc_block.h>
+#include <vlc_frame.h>
#include <assert.h>
@@ -53,10 +53,10 @@
/* audio filter */
static int OpenFilter ( vlc_object_t * );
static void CloseFilter( vlc_object_t * );
-static block_t *Resample( filter_t *, block_t * );
+static vlc_frame_t *Resample( filter_t *, vlc_frame_t * );
static void ResampleFloat( filter_t *p_filter,
- block_t **pp_out_buf, size_t *pi_out,
+ vlc_frame_t **pp_out_buf, size_t *pi_out,
float **pp_in,
int i_in, int i_in_end,
double d_factor, bool b_factor_old,
@@ -97,12 +97,12 @@ vlc_module_end ()
/*****************************************************************************
* Resample: convert a buffer
*****************************************************************************/
-static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *Resample( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
if( !p_in_buf || !p_in_buf->i_nb_samples )
{
if( p_in_buf )
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
@@ -113,11 +113,11 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
/* Check if we really need to run the resampler */
if( i_out_rate == p_filter->fmt_in.audio.i_rate )
{
- if( !(p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY) &&
+ if( !(p_in_buf->i_flags & FRAME_FLAG_DISCONTINUITY) &&
p_sys->i_old_wing )
{
/* output the whole thing with the samples from last time */
- p_in_buf = block_Realloc( p_in_buf,
+ p_in_buf = vlc_frame_Realloc( p_in_buf,
p_sys->i_old_wing * p_filter->fmt_in.audio.i_bytes_per_frame,
p_in_buf->i_buffer );
if( !p_in_buf )
@@ -144,18 +144,18 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
size_t i_out_size = i_bytes_per_frame * ( 1 + ( p_in_buf->i_nb_samples *
p_filter->fmt_out.audio.i_rate / p_filter->fmt_in.audio.i_rate) )
+ p_filter->p_sys->i_buf_size;
- block_t *p_out_buf = block_Alloc( i_out_size );
+ vlc_frame_t *p_out_buf = vlc_frame_Alloc( i_out_size );
if( !p_out_buf )
{
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
- if( (p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY) || p_sys->b_first )
+ if( (p_in_buf->i_flags & FRAME_FLAG_DISCONTINUITY) || p_sys->b_first )
{
/* Continuity in sound samples has been broken, we'd better reset
* everything. */
- p_out_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
+ p_out_buf->i_flags |= FRAME_FLAG_DISCONTINUITY;
p_sys->i_remainder = 0;
date_Init( &p_sys->end_date, i_out_rate, 1 );
date_Set( &p_sys->end_date, p_in_buf->i_pts );
@@ -183,7 +183,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
{ /* Copy all our samples in p_in_buf */
/* Normally, there should be enough room for the old wing in the
* buffer head room. Otherwise, we need to copy memory anyway. */
- p_in_buf = block_Realloc( p_in_buf,
+ p_in_buf = vlc_frame_Realloc( p_in_buf,
p_sys->i_old_wing * 2 * i_bytes_per_frame,
p_in_buf->i_buffer );
if( unlikely(p_in_buf == NULL) )
@@ -260,7 +260,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
else
{
p_sys->i_buf_size = p_sys->i_old_wing = 0; /* oops! */
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
}
@@ -275,7 +275,7 @@ static block_t *Resample( filter_t * p_filter, block_t * p_in_buf )
i_out * p_filter->fmt_in.audio.i_bytes_per_frame );
#endif
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
@@ -431,7 +431,7 @@ static void FilterFloatUD( const float Imp[], const float ImpD[], uint16_t Nwing
}
}
-static int ReallocBuffer( block_t **pp_out_buf,
+static int ReallocBuffer( vlc_frame_t **pp_out_buf,
float **pp_out, size_t i_out,
int i_nb_channels, int i_bytes_per_frame )
{
@@ -440,7 +440,7 @@ static int ReallocBuffer( block_t **pp_out_buf,
/* It may happen when the wing size changes */
const unsigned i_extra_frame = 256;
- *pp_out_buf = block_Realloc( *pp_out_buf, 0,
+ *pp_out_buf = vlc_frame_Realloc( *pp_out_buf, 0,
(*pp_out_buf)->i_buffer +
i_extra_frame * i_bytes_per_frame );
if( !*pp_out_buf )
@@ -452,7 +452,7 @@ static int ReallocBuffer( block_t **pp_out_buf,
}
static void ResampleFloat( filter_t *p_filter,
- block_t **pp_out_buf, size_t *pi_out,
+ vlc_frame_t **pp_out_buf, size_t *pi_out,
float **pp_in,
int i_in, int i_in_end,
double d_factor, bool b_factor_old,
diff --git a/modules/audio_filter/resampler/soxr.c b/modules/audio_filter/resampler/soxr.c
index 1d08d8527f..8d9a06b6aa 100644
--- a/modules/audio_filter/resampler/soxr.c
+++ b/modules/audio_filter/resampler/soxr.c
@@ -90,8 +90,8 @@ typedef struct
vlc_tick_t i_last_pts;
} filter_sys_t;
-static block_t *Resample( filter_t *, block_t * );
-static block_t *Drain( filter_t * );
+static vlc_frame_t *Resample( filter_t *, vlc_frame_t * );
+static vlc_frame_t *Drain( filter_t * );
static void Flush( filter_t * );
static bool
@@ -231,22 +231,22 @@ Close( vlc_object_t *p_obj )
free( p_sys );
}
-static block_t *
-SoXR_Resample( filter_t *p_filter, soxr_t soxr, block_t *p_in, size_t i_olen )
+static vlc_frame_t *
+SoXR_Resample( filter_t *p_filter, soxr_t soxr, vlc_frame_t *p_in, size_t i_olen )
{
filter_sys_t *p_sys = p_filter->p_sys;
size_t i_idone, i_odone;
const size_t i_oframesize = p_filter->fmt_out.audio.i_bytes_per_frame;
const size_t i_ilen = p_in ? p_in->i_nb_samples : 0;
- block_t *p_out;
+ vlc_frame_t *p_out;
if( i_ilen >= i_olen )
{
i_olen = i_ilen;
p_out = p_in;
}
else
- p_out = block_Alloc( i_olen * i_oframesize );
+ p_out = vlc_frame_Alloc( i_olen * i_oframesize );
soxr_error_t error = soxr_process( soxr, p_in ? p_in->p_buffer : NULL,
i_ilen, &i_idone, p_out->p_buffer,
@@ -254,7 +254,7 @@ SoXR_Resample( filter_t *p_filter, soxr_t soxr, block_t *p_in, size_t i_olen )
if( error )
{
msg_Err( p_filter, "soxr_process failed: %s", soxr_strerror( error ) );
- block_Release( p_out );
+ vlc_frame_Release( p_out );
goto error;
}
if( unlikely( i_idone < i_ilen ) )
@@ -279,7 +279,7 @@ SoXR_Resample( filter_t *p_filter, soxr_t soxr, block_t *p_in, size_t i_olen )
error:
if( p_in && p_out != p_in )
- block_Release( p_in );
+ vlc_frame_Release( p_in );
return p_out;
}
@@ -292,8 +292,8 @@ SoXR_GetOutLen( size_t i_ilen, double f_ratio )
return lrint( ( i_ilen + 2 ) * f_ratio * 11. / 10. );
}
-static block_t *
-Resample( filter_t *p_filter, block_t *p_in )
+static vlc_frame_t *
+Resample( filter_t *p_filter, vlc_frame_t *p_in )
{
filter_sys_t *p_sys = p_filter->p_sys;
const vlc_tick_t i_pts = p_in->i_pts;
@@ -305,7 +305,7 @@ Resample( filter_t *p_filter, block_t *p_in )
* resampler. */
soxr_t soxr;
- block_t *p_flushed_out = NULL, *p_out = NULL;
+ vlc_frame_t *p_flushed_out = NULL, *p_out = NULL;
const double f_ratio = p_filter->fmt_out.audio.i_rate
/ (double) p_filter->fmt_in.audio.i_rate;
const size_t i_olen = SoXR_GetOutLen( p_in->i_nb_samples, f_ratio );
@@ -351,8 +351,8 @@ Resample( filter_t *p_filter, block_t *p_in )
const unsigned i_nb_samples = p_flushed_out->i_nb_samples
+ p_out->i_nb_samples;
- block_ChainAppend( &p_flushed_out, p_out );
- p_out = block_ChainGather( p_flushed_out );
+ vlc_frame_ChainAppend( &p_flushed_out, p_out );
+ p_out = vlc_frame_ChainGather( p_flushed_out );
if( !p_out )
goto error;
p_out->i_nb_samples = i_nb_samples;
@@ -366,17 +366,17 @@ Resample( filter_t *p_filter, block_t *p_in )
const size_t i_olen = SoXR_GetOutLen( p_in->i_nb_samples,
p_sys->f_fixed_ratio );
- block_t *p_out = SoXR_Resample( p_filter, p_sys->soxr, p_in, i_olen );
+ vlc_frame_t *p_out = SoXR_Resample( p_filter, p_sys->soxr, p_in, i_olen );
if( p_out )
p_out->i_pts = i_pts;
return p_out;
}
error:
- block_Release( p_in );
+ vlc_frame_Release( p_in );
return NULL;
}
-static block_t *
+static vlc_frame_t *
Drain( filter_t *p_filter )
{
filter_sys_t *p_sys = p_filter->p_sys;
diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c
index eeefc4f4c4..967748d2d6 100644
--- a/modules/audio_filter/resampler/speex.c
+++ b/modules/audio_filter/resampler/speex.c
@@ -55,7 +55,7 @@ vlc_module_begin ()
add_shortcut ("speex")
vlc_module_end ()
-static block_t *Resample (filter_t *, block_t *);
+static vlc_frame_t *Resample (filter_t *, vlc_frame_t *);
static int OpenResampler (vlc_object_t *obj)
{
@@ -115,7 +115,7 @@ static void Close (vlc_object_t *obj)
speex_resampler_destroy (st);
}
-static block_t *Resample (filter_t *filter, block_t *in)
+static vlc_frame_t *Resample (filter_t *filter, vlc_frame_t *in)
{
SpeexResamplerState *st = (SpeexResamplerState *)filter->p_sys;
@@ -127,7 +127,7 @@ static block_t *Resample (filter_t *filter, block_t *in)
spx_uint32_t olen = ((ilen + 2) * orate * UINT64_C(11))
/ (irate * UINT64_C(10));
- block_t *out = block_Alloc (olen * framesize);
+ vlc_frame_t *out = vlc_frame_Alloc (olen * framesize);
if (unlikely(out == NULL))
goto error;
@@ -144,7 +144,7 @@ static block_t *Resample (filter_t *filter, block_t *in)
{
msg_Err (filter, "cannot resample: %s",
speex_resampler_strerror (err));
- block_Release (out);
+ vlc_frame_Release (out);
out = NULL;
goto error;
}
@@ -158,6 +158,6 @@ static block_t *Resample (filter_t *filter, block_t *in)
out->i_pts = in->i_pts;
out->i_length = vlc_tick_from_samples(olen, filter->fmt_out.audio.i_rate);
error:
- block_Release (in);
+ vlc_frame_Release (in);
return out;
}
diff --git a/modules/audio_filter/resampler/src.c b/modules/audio_filter/resampler/src.c
index 1254314b13..5192c2f307 100644
--- a/modules/audio_filter/resampler/src.c
+++ b/modules/audio_filter/resampler/src.c
@@ -70,7 +70,7 @@ vlc_module_begin ()
set_callbacks (OpenResampler, Close)
vlc_module_end ()
-static block_t *Resample (filter_t *, block_t *);
+static vlc_frame_t *Resample (filter_t *, vlc_frame_t *);
static int Open (vlc_object_t *obj)
{
@@ -116,9 +116,9 @@ static void Close (vlc_object_t *obj)
src_delete (s);
}
-static block_t *Resample (filter_t *filter, block_t *in)
+static vlc_frame_t *Resample (filter_t *filter, vlc_frame_t *in)
{
- block_t *out = NULL;
+ vlc_frame_t *out = NULL;
const size_t framesize = filter->fmt_out.audio.i_bytes_per_frame;
SRC_STATE *s = (SRC_STATE *)filter->p_sys;
@@ -139,7 +139,7 @@ static block_t *Resample (filter_t *filter, block_t *in)
src.output_frames = ceil (src.src_ratio * src.input_frames);
src.end_of_input = 0;
- out = block_Alloc (src.output_frames * framesize);
+ out = vlc_frame_Alloc (src.output_frames * framesize);
if (unlikely(out == NULL))
goto error;
@@ -150,7 +150,7 @@ static block_t *Resample (filter_t *filter, block_t *in)
if (err != 0)
{
msg_Err (filter, "cannot resample: %s", src_strerror (err));
- block_Release (out);
+ vlc_frame_Release (out);
out = NULL;
goto error;
}
@@ -164,6 +164,6 @@ static block_t *Resample (filter_t *filter, block_t *in)
out->i_pts = in->i_pts;
out->i_length = vlc_tick_from_samples(src.output_frames_gen, filter->fmt_out.audio.i_rate);
error:
- block_Release (in);
+ vlc_frame_Release (in);
return out;
}
diff --git a/modules/audio_filter/resampler/ugly.c b/modules/audio_filter/resampler/ugly.c
index a802cc9ae3..7983e22532 100644
--- a/modules/audio_filter/resampler/ugly.c
+++ b/modules/audio_filter/resampler/ugly.c
@@ -39,7 +39,7 @@
static int Create (vlc_object_t *);
static int CreateResampler (vlc_object_t *);
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
/*****************************************************************************
* Module descriptor
@@ -84,13 +84,13 @@ static int CreateResampler( vlc_object_t *p_this )
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
-static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
/* Check if we really need to run the resampler */
if( p_filter->fmt_out.audio.i_rate == p_filter->fmt_in.audio.i_rate )
return p_in_buf;
- block_t *p_out_buf = p_in_buf;
+ vlc_frame_t *p_out_buf = p_in_buf;
unsigned int i_out_nb = p_in_buf->i_nb_samples
* p_filter->fmt_out.audio.i_rate / p_filter->fmt_in.audio.i_rate;
const unsigned framesize = (p_filter->fmt_in.audio.i_bitspersample / 8)
@@ -98,7 +98,7 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
if( p_filter->fmt_out.audio.i_rate > p_filter->fmt_in.audio.i_rate )
{
- p_out_buf = block_Alloc( i_out_nb * framesize );
+ p_out_buf = vlc_frame_Alloc( i_out_nb * framesize );
if( !p_out_buf )
goto out;
}
@@ -129,6 +129,6 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
if( p_in_buf != p_out_buf )
out:
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
diff --git a/modules/audio_filter/scaletempo.c b/modules/audio_filter/scaletempo.c
index d1b66f45ee..2672dff132 100644
--- a/modules/audio_filter/scaletempo.c
+++ b/modules/audio_filter/scaletempo.c
@@ -42,12 +42,12 @@
*****************************************************************************/
static int Open( vlc_object_t * );
static void Close( vlc_object_t * );
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
#ifdef PITCH_SHIFTER
static int OpenPitch( vlc_object_t * );
static void ClosePitch( vlc_object_t * );
-static block_t *DoPitchWork( filter_t *, block_t * );
+static vlc_frame_t *DoPitchWork( filter_t *, vlc_frame_t * );
# define MODULE_DESC N_("Pitch Shifter")
# define MODULES_SHORTNAME N_("Audio pitch changer")
#else
@@ -547,7 +547,7 @@ static void ClosePitch( vlc_object_t *p_this )
/*****************************************************************************
* DoWork: filter wrapper for transform_buffer
*****************************************************************************/
-static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
filter_sys_t *p = p_filter->p_sys;
@@ -565,17 +565,17 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
(int)( p->bytes_stride / p->bytes_per_frame ), p->sample_rate );
}
- block_t *p_out_buf = NULL;
+ vlc_frame_t *p_out_buf = NULL;
size_t i_outsize = calculate_output_buffer_size ( p_filter, p_in_buf->i_buffer );
size_t offset_in = fill_queue( p_filter, p_in_buf->p_buffer,
p_in_buf->i_buffer, 0 );
if( i_outsize > 0 )
{
- p_out_buf = block_Alloc( i_outsize );
+ p_out_buf = vlc_frame_Alloc( i_outsize );
if( p_out_buf == NULL )
{
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return NULL;
}
size_t bytes_out = 0;
@@ -595,12 +595,12 @@ static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
p_filter->fmt_out.audio.i_rate);
}
- block_Release( p_in_buf );
+ vlc_frame_Release( p_in_buf );
return p_out_buf;
}
#ifdef PITCH_SHIFTER
-static block_t *DoPitchWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoPitchWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
filter_sys_t *p = p_filter->p_sys;
diff --git a/modules/audio_filter/spatializer/spatializer.cpp b/modules/audio_filter/spatializer/spatializer.cpp
index eccde1331e..b26761bb40 100644
--- a/modules/audio_filter/spatializer/spatializer.cpp
+++ b/modules/audio_filter/spatializer/spatializer.cpp
@@ -132,7 +132,7 @@ static const callback_s callbacks[] = {
};
enum { num_callbacks=sizeof(callbacks)/sizeof(callback_s) };
-static block_t *DoWork( filter_t *, block_t * );
+static vlc_frame_t *DoWork( filter_t *, vlc_frame_t * );
/*****************************************************************************
* Open:
@@ -220,7 +220,7 @@ static void SpatFilter( filter_t *p_filter, float *out, float *in,
}
}
-static block_t *DoWork( filter_t * p_filter, block_t * p_in_buf )
+static vlc_frame_t *DoWork( filter_t * p_filter, vlc_frame_t * p_in_buf )
{
SpatFilter( p_filter, (float*)p_in_buf->p_buffer,
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
diff --git a/modules/audio_filter/stereo_widen.c b/modules/audio_filter/stereo_widen.c
index 1ec29bfffd..6d4ed0a0f9 100644
--- a/modules/audio_filter/stereo_widen.c
+++ b/modules/audio_filter/stereo_widen.c
@@ -35,7 +35,7 @@
static int Open ( vlc_object_t * );
static void Close( vlc_object_t * );
-static block_t *Filter ( filter_t *, block_t * );
+static vlc_frame_t *Filter ( filter_t *, vlc_frame_t * );
static int paramCallback( vlc_object_t *, char const *, vlc_value_t ,
vlc_value_t , void * );
@@ -160,13 +160,13 @@ static int Open( vlc_object_t *obj )
/*****************************************************************************
* Filter: process each sample
*****************************************************************************/
-static block_t *Filter( filter_t *p_filter, block_t *p_block )
+static vlc_frame_t *Filter( filter_t *p_filter, vlc_frame_t *p_frame )
{
filter_sys_t *p_sys = p_filter->p_sys;
- float *p_out = (float *)p_block->p_buffer;
+ float *p_out = (float *)p_frame->p_buffer;
float *pf_read;
- for (unsigned i = p_block->i_nb_samples; i > 0; i--)
+ for (unsigned i = p_frame->i_nb_samples; i > 0; i--)
{
pf_read = p_sys->pf_write + 2;
/* if at end of buffer put read ptr at begin */
@@ -188,7 +188,7 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
p_sys->pf_write = p_sys->pf_ringbuf;
}
- return p_block;
+ return p_frame;
}
/*****************************************************************************
--
2.20.1
More information about the vlc-devel
mailing list