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
7a161b74
Commit
7a161b74
authored
Oct 08, 2015
by
Rodger Combs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/tee: use lavf API for applying bitstream filters
parent
a5fd3a1a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
43 deletions
+3
-43
tee.c
libavformat/tee.c
+3
-43
No files found.
libavformat/tee.c
View file @
7a161b74
...
@@ -405,47 +405,6 @@ fail:
...
@@ -405,47 +405,6 @@ fail:
return
ret
;
return
ret
;
}
}
static
int
filter_packet
(
void
*
log_ctx
,
AVPacket
*
pkt
,
AVFormatContext
*
fmt_ctx
,
AVBitStreamFilterContext
*
bsf_ctx
)
{
AVCodecContext
*
enc_ctx
=
fmt_ctx
->
streams
[
pkt
->
stream_index
]
->
codec
;
int
ret
=
0
;
while
(
bsf_ctx
)
{
AVPacket
new_pkt
=
*
pkt
;
ret
=
av_bitstream_filter_filter
(
bsf_ctx
,
enc_ctx
,
NULL
,
&
new_pkt
.
data
,
&
new_pkt
.
size
,
pkt
->
data
,
pkt
->
size
,
pkt
->
flags
&
AV_PKT_FLAG_KEY
);
if
(
ret
==
0
&&
new_pkt
.
data
!=
pkt
->
data
)
{
if
((
ret
=
av_copy_packet
(
&
new_pkt
,
pkt
))
<
0
)
break
;
ret
=
1
;
}
if
(
ret
>
0
)
{
pkt
->
side_data
=
NULL
;
pkt
->
side_data_elems
=
0
;
av_packet_unref
(
pkt
);
new_pkt
.
buf
=
av_buffer_create
(
new_pkt
.
data
,
new_pkt
.
size
,
av_buffer_default_free
,
NULL
,
0
);
if
(
!
new_pkt
.
buf
)
break
;
}
if
(
ret
<
0
)
{
av_log
(
log_ctx
,
AV_LOG_ERROR
,
"Failed to filter bitstream with filter %s for stream %d in file '%s' with codec %s
\n
"
,
bsf_ctx
->
filter
->
name
,
pkt
->
stream_index
,
fmt_ctx
->
filename
,
avcodec_get_name
(
enc_ctx
->
codec_id
));
}
*
pkt
=
new_pkt
;
bsf_ctx
=
bsf_ctx
->
next
;
}
return
ret
;
}
static
int
tee_write_trailer
(
AVFormatContext
*
avf
)
static
int
tee_write_trailer
(
AVFormatContext
*
avf
)
{
{
TeeContext
*
tee
=
avf
->
priv_data
;
TeeContext
*
tee
=
avf
->
priv_data
;
...
@@ -498,8 +457,9 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
...
@@ -498,8 +457,9 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
pkt2
.
duration
=
av_rescale_q
(
pkt
->
duration
,
tb
,
tb2
);
pkt2
.
duration
=
av_rescale_q
(
pkt
->
duration
,
tb
,
tb2
);
pkt2
.
stream_index
=
s2
;
pkt2
.
stream_index
=
s2
;
filter_packet
(
avf2
,
&
pkt2
,
avf2
,
tee
->
slaves
[
i
].
bsfs
[
s2
]);
if
((
ret
=
av_apply_bitstream_filters
(
avf2
->
streams
[
s2
]
->
codec
,
&
pkt2
,
if
((
ret
=
av_interleaved_write_frame
(
avf2
,
&
pkt2
))
<
0
)
tee
->
slaves
[
i
].
bsfs
[
s2
]))
<
0
||
(
ret
=
av_interleaved_write_frame
(
avf2
,
&
pkt2
))
<
0
)
if
(
!
ret_all
)
if
(
!
ret_all
)
ret_all
=
ret
;
ret_all
=
ret
;
}
}
...
...
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