Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2ef4d586
Commit
2ef4d586
authored
Oct 24, 2012
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcmdec: remove dependency from rawdec
The code shared is not actually shared with anything else.
parent
5f0e161d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
22 deletions
+55
-22
Makefile
libavformat/Makefile
+20
-20
pcmdec.c
libavformat/pcmdec.c
+35
-2
No files found.
libavformat/Makefile
View file @
2ef4d586
...
@@ -195,45 +195,45 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
...
@@ -195,45 +195,45 @@ OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \
vorbiscomment.o
vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
oma.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
oma.o
OBJS-$(CONFIG_OMA_MUXER)
+=
omaenc.o
rawenc.o
oma.o
id3v2enc.o
OBJS-$(CONFIG_OMA_MUXER)
+=
omaenc.o
rawenc.o
oma.o
id3v2enc.o
OBJS-$(CONFIG_PCM_ALAW_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_ALAW_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_ALAW_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_ALAW_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F32BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_F32BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_F32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F32LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_F32LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_F32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F64BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_F64BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_F64BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F64BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F64LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_F64LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_F64LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_F64LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_MULAW_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_MULAW_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_MULAW_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_MULAW_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S16BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S16BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S16BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S16BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S16LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S16LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S16LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S16LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S24BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S24BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S24BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S24BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S24LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S24LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S24LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S24LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S32BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S32BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S32LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S32LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S8_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_S8_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_S8_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_S8_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U16BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U16BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U16BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U16BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U16LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U16LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U16LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U16LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U24BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U24BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U24BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U24BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U24LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U24LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U24LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U24LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U32BE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U32BE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U32BE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U32LE_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U32LE_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U32LE_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U8_DEMUXER)
+=
pcmdec.o
pcm.o
rawdec.o
OBJS-$(CONFIG_PCM_U8_DEMUXER)
+=
pcmdec.o
pcm.o
OBJS-$(CONFIG_PCM_U8_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PCM_U8_MUXER)
+=
pcmenc.o
rawenc.o
OBJS-$(CONFIG_PMP_DEMUXER)
+=
pmpdec.o
OBJS-$(CONFIG_PMP_DEMUXER)
+=
pmpdec.o
OBJS-$(CONFIG_PVA_DEMUXER)
+=
pva.o
OBJS-$(CONFIG_PVA_DEMUXER)
+=
pva.o
...
...
libavformat/pcmdec.c
View file @
2ef4d586
...
@@ -20,13 +20,46 @@
...
@@ -20,13 +20,46 @@
*/
*/
#include "avformat.h"
#include "avformat.h"
#include "
rawdec
.h"
#include "
internal
.h"
#include "pcm.h"
#include "pcm.h"
#include "libavutil/log.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/opt.h"
#define RAW_SAMPLES 1024
#define RAW_SAMPLES 1024
typedef
struct
RawAudioDemuxerContext
{
AVClass
*
class
;
int
sample_rate
;
int
channels
;
}
RawAudioDemuxerContext
;
static
int
raw_read_header
(
AVFormatContext
*
s
)
{
RawAudioDemuxerContext
*
s1
=
s
->
priv_data
;
AVStream
*
st
;
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
codec_id
=
s
->
iformat
->
raw_codec_id
;
st
->
codec
->
sample_rate
=
s1
->
sample_rate
;
st
->
codec
->
channels
=
s1
->
channels
;
st
->
codec
->
bits_per_coded_sample
=
av_get_bits_per_sample
(
st
->
codec
->
codec_id
);
assert
(
st
->
codec
->
bits_per_coded_sample
>
0
);
st
->
codec
->
block_align
=
st
->
codec
->
bits_per_coded_sample
*
st
->
codec
->
channels
/
8
;
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
return
0
;
}
static
int
raw_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
raw_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
int
ret
,
size
,
bps
;
int
ret
,
size
,
bps
;
...
@@ -65,7 +98,7 @@ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
...
@@ -65,7 +98,7 @@ AVInputFormat ff_pcm_ ## name_ ## _demuxer = { \
.name = #name_, \
.name = #name_, \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
.priv_data_size = sizeof(RawAudioDemuxerContext), \
.priv_data_size = sizeof(RawAudioDemuxerContext), \
.read_header =
ff_raw_read_header,
\
.read_header =
raw_read_header,
\
.read_packet = raw_read_packet, \
.read_packet = raw_read_packet, \
.read_seek = ff_pcm_read_seek, \
.read_seek = ff_pcm_read_seek, \
.flags = AVFMT_GENERIC_INDEX, \
.flags = AVFMT_GENERIC_INDEX, \
...
...
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