Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
17485fb4
Commit
17485fb4
authored
Oct 23, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added decoder_NewAudioBuffer/decoder_DeleteAudioBuffer helpers.
parent
7765d6b8
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
60 additions
and
33 deletions
+60
-33
include/vlc_codec.h
include/vlc_codec.h
+19
-5
modules/codec/a52.c
modules/codec/a52.c
+1
-1
modules/codec/adpcm.c
modules/codec/adpcm.c
+1
-1
modules/codec/aes3.c
modules/codec/aes3.c
+1
-1
modules/codec/araw.c
modules/codec/araw.c
+1
-1
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+1
-4
modules/codec/dmo/dmo.c
modules/codec/dmo/dmo.c
+10
-9
modules/codec/dts.c
modules/codec/dts.c
+1
-1
modules/codec/faad.c
modules/codec/faad.c
+1
-1
modules/codec/flac.c
modules/codec/flac.c
+1
-1
modules/codec/fluidsynth.c
modules/codec/fluidsynth.c
+1
-1
modules/codec/lpcm.c
modules/codec/lpcm.c
+1
-1
modules/codec/mpeg_audio.c
modules/codec/mpeg_audio.c
+1
-1
modules/codec/quicktime.c
modules/codec/quicktime.c
+1
-1
modules/codec/realaudio.c
modules/codec/realaudio.c
+1
-1
modules/codec/speex.c
modules/codec/speex.c
+2
-2
modules/codec/vorbis.c
modules/codec/vorbis.c
+1
-1
src/input/decoder.c
src/input/decoder.c
+13
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-0
No files found.
include/vlc_codec.h
View file @
17485fb4
...
...
@@ -85,10 +85,6 @@ struct decoder_t
* Buffers allocation
*/
/* Audio output callbacks */
aout_buffer_t
*
(
*
pf_aout_buffer_new
)
(
decoder_t
*
,
int
);
void
(
*
pf_aout_buffer_del
)
(
decoder_t
*
,
aout_buffer_t
*
);
/* Video output callbacks */
picture_t
*
(
*
pf_vout_buffer_new
)
(
decoder_t
*
);
void
(
*
pf_vout_buffer_del
)
(
decoder_t
*
,
picture_t
*
);
...
...
@@ -99,6 +95,11 @@ struct decoder_t
* Owner fields
*/
/* Audio output callbacks
* XXX use decoder_NewAudioBuffer/decoder_DeleteAudioBuffer */
aout_buffer_t
*
(
*
pf_aout_buffer_new
)
(
decoder_t
*
,
int
);
void
(
*
pf_aout_buffer_del
)
(
decoder_t
*
,
aout_buffer_t
*
);
/* SPU output callbacks
* XXX use decoder_NewSubpicture and decoder_DeleteSubpicture */
subpicture_t
*
(
*
pf_spu_buffer_new
)
(
decoder_t
*
);
...
...
@@ -164,6 +165,19 @@ struct encoder_t
* @}
*/
/**
* This function will return a new audio buffer usable by a decoder as an
* output buffer. You have to release it using decoder_DeleteAudioBuffer
* or by returning it to the caller as a pf_decode_audio return value.
*/
VLC_EXPORT
(
aout_buffer_t
*
,
decoder_NewAudioBuffer
,
(
decoder_t
*
,
int
i_size
)
);
/**
* This function will release a audio buffer created by decoder_NewAudioBuffer.
*/
VLC_EXPORT
(
void
,
decoder_DeleteAudioBuffer
,
(
decoder_t
*
,
aout_buffer_t
*
p_buffer
)
);
/**
* This function will return a new subpicture usable by a decoder as an output
* buffer. You have to release it using decoder_DeleteSubpicture or by returning
...
...
@@ -172,7 +186,7 @@ struct encoder_t
VLC_EXPORT
(
subpicture_t
*
,
decoder_NewSubpicture
,
(
decoder_t
*
)
);
/**
* This function will release a subpicture create by decoder_NewSubicture.
* This function will release a subpicture create
d
by decoder_NewSubicture.
*/
VLC_EXPORT
(
void
,
decoder_DeleteSubpicture
,
(
decoder_t
*
,
subpicture_t
*
p_subpicture
)
);
...
...
modules/codec/a52.c
View file @
17485fb4
...
...
@@ -397,7 +397,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
aout_buffer_t
*
p_buf
;
p_buf
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
A52_FRAME_NB
);
p_buf
=
decoder_NewAudioBuffer
(
p_dec
,
A52_FRAME_NB
);
if
(
p_buf
==
NULL
)
return
NULL
;
p_buf
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
...
...
modules/codec/adpcm.c
View file @
17485fb4
...
...
@@ -292,7 +292,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
aout_buffer_t
*
p_out
;
p_out
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
p_sys
->
i_samplesperblock
);
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
p_sys
->
i_samplesperblock
);
if
(
p_out
==
NULL
)
{
block_Release
(
p_block
);
...
...
modules/codec/aes3.c
View file @
17485fb4
...
...
@@ -130,7 +130,7 @@ static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block )
if
(
!
p_block
)
return
NULL
;
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_frame_length
);
p_aout_buffer
=
decoder_NewAudioBuffer
(
p_dec
,
i_frame_length
);
if
(
p_aout_buffer
==
NULL
)
goto
exit
;
...
...
modules/codec/araw.c
View file @
17485fb4
...
...
@@ -455,7 +455,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Create chunks of max 1024 samples */
i_samples
=
__MIN
(
i_samples
,
1024
);
p_out
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_samples
);
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
i_samples
);
if
(
p_out
==
NULL
)
{
block_Release
(
p_block
);
...
...
modules/codec/avcodec/audio.c
View file @
17485fb4
...
...
@@ -223,11 +223,8 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec )
if
(
i_samples
==
0
)
return
NULL
;
if
(
(
p_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_samples
)
)
==
NULL
)
{
msg_Err
(
p_dec
,
"cannot get aout buffer"
);
if
(
(
p_buffer
=
decoder_NewAudioBuffer
(
p_dec
,
i_samples
)
)
==
NULL
)
return
NULL
;
}
p_buffer
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
p_buffer
->
end_date
=
aout_DateIncrement
(
&
p_sys
->
end_date
,
i_samples
);
...
...
modules/codec/dmo/dmo.c
View file @
17485fb4
...
...
@@ -928,15 +928,16 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
(
p_dec
->
fmt_out
.
audio
.
i_bitspersample
*
p_dec
->
fmt_out
.
audio
.
i_channels
/
8
);
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_samples
);
memcpy
(
p_aout_buffer
->
p_buffer
,
block_out
.
p_buffer
,
block_out
.
i_buffer
);
/* Date management */
p_aout_buffer
->
start_date
=
date_Get
(
&
p_sys
->
end_date
);
p_aout_buffer
->
end_date
=
date_Increment
(
&
p_sys
->
end_date
,
i_samples
);
p_aout_buffer
=
decoder_NewAudioBuffer
(
p_dec
,
i_samples
);
if
(
p_aout_buffer
)
{
memcpy
(
p_aout_buffer
->
p_buffer
,
block_out
.
p_buffer
,
block_out
.
i_buffer
);
/* Date management */
p_aout_buffer
->
start_date
=
date_Get
(
&
p_sys
->
end_date
);
p_aout_buffer
->
end_date
=
date_Increment
(
&
p_sys
->
end_date
,
i_samples
);
}
p_out
->
vt
->
Release
(
(
IUnknown
*
)
p_out
);
return
p_aout_buffer
;
...
...
modules/codec/dts.c
View file @
17485fb4
...
...
@@ -385,7 +385,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
/* Hack for DTS S/PDIF filter which needs to send 3 frames at a time
* (plus a few header bytes) */
p_buf
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
p_sys
->
i_frame_length
*
4
);
p_buf
=
decoder_NewAudioBuffer
(
p_dec
,
p_sys
->
i_frame_length
*
4
);
if
(
p_buf
==
NULL
)
return
NULL
;
p_buf
->
i_nb_samples
=
p_sys
->
i_frame_length
;
p_buf
->
i_nb_bytes
=
p_sys
->
i_frame_size
;
...
...
modules/codec/faad.c
View file @
17485fb4
...
...
@@ -415,7 +415,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_dec
->
fmt_out
.
audio
.
i_original_channels
=
p_dec
->
fmt_out
.
audio
.
i_physical_channels
;
p_out
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
frame
.
samples
/
frame
.
channels
);
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
frame
.
samples
/
frame
.
channels
);
if
(
p_out
==
NULL
)
{
p_sys
->
i_buffer
=
0
;
...
...
modules/codec/flac.c
View file @
17485fb4
...
...
@@ -621,7 +621,7 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
p_sys
->
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
frame
->
header
.
blocksize
);
decoder_NewAudioBuffer
(
p_dec
,
frame
->
header
.
blocksize
);
if
(
p_sys
->
p_aout_buffer
==
NULL
)
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
...
...
modules/codec/fluidsynth.c
View file @
17485fb4
...
...
@@ -177,7 +177,7 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
if
(
samples
==
0
)
return
NULL
;
aout_buffer_t
*
p_out
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
samples
);
aout_buffer_t
*
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
samples
);
if
(
p_out
==
NULL
)
{
block_Release
(
p_block
);
...
...
modules/codec/lpcm.c
View file @
17485fb4
...
...
@@ -311,7 +311,7 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
else
{
aout_buffer_t
*
p_aout_buffer
;
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_frame_length
);
p_aout_buffer
=
decoder_NewAudioBuffer
(
p_dec
,
i_frame_length
);
if
(
p_aout_buffer
==
NULL
)
return
NULL
;
p_aout_buffer
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
...
...
modules/codec/mpeg_audio.c
View file @
17485fb4
...
...
@@ -533,7 +533,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
aout_buffer_t
*
p_buf
;
p_buf
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
p_sys
->
i_frame_length
);
p_buf
=
decoder_NewAudioBuffer
(
p_dec
,
p_sys
->
i_frame_length
);
if
(
p_buf
==
NULL
)
return
NULL
;
p_buf
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
...
...
modules/codec/quicktime.c
View file @
17485fb4
...
...
@@ -649,7 +649,7 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
aout_buffer_t
*
p_out
;
int
i_frames
=
__MIN
(
p_sys
->
i_out_frames
-
p_sys
->
i_out
,
1000
);
p_out
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_frames
);
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
i_frames
);
if
(
p_out
)
{
...
...
modules/codec/realaudio.c
View file @
17485fb4
...
...
@@ -706,7 +706,7 @@ static aout_buffer_t *Decode( decoder_t *p_dec, block_t **pp_block )
p_dec
->
fmt_out
.
audio
.
i_bitspersample
/
p_dec
->
fmt_out
.
audio
.
i_channels
;
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_samples
);
decoder_NewAudioBuffer
(
p_dec
,
i_samples
);
if
(
p_aout_buffer
)
{
memcpy
(
p_aout_buffer
->
p_buffer
,
p_sys
->
p_out
,
p_sys
->
i_out
);
...
...
modules/codec/speex.c
View file @
17485fb4
...
...
@@ -684,7 +684,7 @@ static aout_buffer_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block
Ask for a new audio output buffer and make sure
we get one.
*/
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
p_aout_buffer
=
decoder_NewAudioBuffer
(
p_dec
,
p_sys
->
p_header
->
frame_size
);
if
(
!
p_aout_buffer
||
p_aout_buffer
->
i_nb_bytes
==
0
)
{
...
...
@@ -748,7 +748,7 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
return
NULL
;
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
p_sys
->
p_header
->
frame_size
);
decoder_NewAudioBuffer
(
p_dec
,
p_sys
->
p_header
->
frame_size
);
if
(
!
p_aout_buffer
)
{
return
NULL
;
...
...
modules/codec/vorbis.c
View file @
17485fb4
...
...
@@ -549,7 +549,7 @@ static aout_buffer_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
aout_buffer_t
*
p_aout_buffer
;
p_aout_buffer
=
p_dec
->
pf_aout_buffer_new
(
p_dec
,
i_samples
);
decoder_NewAudioBuffer
(
p_dec
,
i_samples
);
if
(
p_aout_buffer
==
NULL
)
return
NULL
;
...
...
src/input/decoder.c
View file @
17485fb4
...
...
@@ -161,6 +161,19 @@ struct decoder_owner_sys_t
/*****************************************************************************
* Public functions
*****************************************************************************/
aout_buffer_t
*
decoder_NewAudioBuffer
(
decoder_t
*
p_decoder
,
int
i_size
)
{
if
(
!
p_decoder
->
pf_aout_buffer_new
)
return
NULL
;
return
p_decoder
->
pf_aout_buffer_new
(
p_decoder
,
i_size
);
}
void
decoder_DeleteAudioBuffer
(
decoder_t
*
p_decoder
,
aout_buffer_t
*
p_buffer
)
{
if
(
!
p_decoder
->
pf_aout_buffer_del
)
return
;
p_decoder
->
pf_aout_buffer_del
(
p_decoder
,
p_buffer
);
}
subpicture_t
*
decoder_NewSubpicture
(
decoder_t
*
p_decoder
)
{
subpicture_t
*
p_subpicture
=
p_decoder
->
pf_spu_buffer_new
(
p_decoder
);
...
...
src/libvlccore.sym
View file @
17485fb4
...
...
@@ -77,10 +77,12 @@ date_Increment
date_Init
date_Move
date_Set
decoder_DeleteAudioBuffer
decoder_DeleteSubpicture
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachments
decoder_NewAudioBuffer
decoder_NewSubpicture
decoder_SynchroChoose
decoder_SynchroDate
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment