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
62106fcc
Commit
62106fcc
authored
Dec 31, 2013
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/alsa: preliminary support of uncoded frame.
parent
1b05ac22
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
alsa-audio-enc.c
libavdevice/alsa-audio-enc.c
+19
-0
No files found.
libavdevice/alsa-audio-enc.c
View file @
62106fcc
...
...
@@ -113,6 +113,24 @@ static int audio_write_packet(AVFormatContext *s1, AVPacket *pkt)
return
0
;
}
static
int
audio_write_frame
(
AVFormatContext
*
s1
,
int
stream_index
,
AVFrame
**
frame
,
unsigned
flags
)
{
AlsaData
*
s
=
s1
->
priv_data
;
AVPacket
pkt
;
/* ff_alsa_open() should have accepted only supported formats */
if
((
flags
&
AV_WRITE_UNCODED_FRAME_QUERY
))
return
av_sample_fmt_is_planar
(
s1
->
streams
[
stream_index
]
->
codec
->
sample_fmt
)
?
AVERROR
(
EINVAL
)
:
0
;
/* set only used fields */
pkt
.
data
=
(
*
frame
)
->
data
[
0
];
pkt
.
size
=
(
*
frame
)
->
nb_samples
*
s
->
frame_size
;
pkt
.
dts
=
(
*
frame
)
->
pkt_dts
;
pkt
.
duration
=
av_frame_get_pkt_duration
(
*
frame
);
return
audio_write_packet
(
s1
,
&
pkt
);
}
static
void
audio_get_output_timestamp
(
AVFormatContext
*
s1
,
int
stream
,
int64_t
*
dts
,
int64_t
*
wall
)
...
...
@@ -133,6 +151,7 @@ AVOutputFormat ff_alsa_muxer = {
.
write_header
=
audio_write_header
,
.
write_packet
=
audio_write_packet
,
.
write_trailer
=
ff_alsa_close
,
.
write_uncoded_frame
=
audio_write_frame
,
.
get_output_timestamp
=
audio_get_output_timestamp
,
.
flags
=
AVFMT_NOFILE
,
};
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