Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
063b1a42
Commit
063b1a42
authored
Dec 18, 2016
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/lavfi: use buffersink accessors.
parent
448f2972
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
lavfi.c
libavdevice/lavfi.c
+19
-18
No files found.
libavdevice/lavfi.c
View file @
063b1a42
...
@@ -312,31 +312,32 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
...
@@ -312,31 +312,32 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
/* fill each stream with the information in the corresponding sink */
/* fill each stream with the information in the corresponding sink */
for
(
i
=
0
;
i
<
lavfi
->
nb_sinks
;
i
++
)
{
for
(
i
=
0
;
i
<
lavfi
->
nb_sinks
;
i
++
)
{
AVFilterLink
*
link
=
lavfi
->
sinks
[
lavfi
->
stream_sink_map
[
i
]]
->
inputs
[
0
];
AVFilterContext
*
sink
=
lavfi
->
sinks
[
lavfi
->
stream_sink_map
[
i
]];
AVRational
time_base
=
av_buffersink_get_time_base
(
sink
);
AVStream
*
st
=
avctx
->
streams
[
i
];
AVStream
*
st
=
avctx
->
streams
[
i
];
st
->
codecpar
->
codec_type
=
link
->
type
;
st
->
codecpar
->
codec_type
=
av_buffersink_get_type
(
sink
)
;
avpriv_set_pts_info
(
st
,
64
,
link
->
time_base
.
num
,
link
->
time_base
.
den
);
avpriv_set_pts_info
(
st
,
64
,
time_base
.
num
,
time_base
.
den
);
if
(
link
->
type
==
AVMEDIA_TYPE_VIDEO
)
{
if
(
av_buffersink_get_type
(
sink
)
==
AVMEDIA_TYPE_VIDEO
)
{
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_RAWVIDEO
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_RAWVIDEO
;
st
->
codecpar
->
format
=
link
->
format
;
st
->
codecpar
->
format
=
av_buffersink_get_format
(
sink
)
;
st
->
codecpar
->
width
=
link
->
w
;
st
->
codecpar
->
width
=
av_buffersink_get_w
(
sink
)
;
st
->
codecpar
->
height
=
link
->
h
;
st
->
codecpar
->
height
=
av_buffersink_get_h
(
sink
)
;
st
->
sample_aspect_ratio
=
st
->
sample_aspect_ratio
=
st
->
codecpar
->
sample_aspect_ratio
=
link
->
sample_aspect_ratio
;
st
->
codecpar
->
sample_aspect_ratio
=
av_buffersink_get_sample_aspect_ratio
(
sink
)
;
avctx
->
probesize
=
FFMAX
(
avctx
->
probesize
,
avctx
->
probesize
=
FFMAX
(
avctx
->
probesize
,
link
->
w
*
link
->
h
*
av_buffersink_get_w
(
sink
)
*
av_buffersink_get_h
(
sink
)
*
av_get_padded_bits_per_pixel
(
av_pix_fmt_desc_get
(
link
->
format
))
*
av_get_padded_bits_per_pixel
(
av_pix_fmt_desc_get
(
av_buffersink_get_format
(
sink
)
))
*
30
);
30
);
}
else
if
(
link
->
type
==
AVMEDIA_TYPE_AUDIO
)
{
}
else
if
(
av_buffersink_get_type
(
sink
)
==
AVMEDIA_TYPE_AUDIO
)
{
st
->
codecpar
->
codec_id
=
av_get_pcm_codec
(
link
->
format
,
-
1
);
st
->
codecpar
->
codec_id
=
av_get_pcm_codec
(
av_buffersink_get_format
(
sink
)
,
-
1
);
st
->
codecpar
->
channels
=
av
filter_link_get_channels
(
l
ink
);
st
->
codecpar
->
channels
=
av
_buffersink_get_channels
(
s
ink
);
st
->
codecpar
->
format
=
link
->
format
;
st
->
codecpar
->
format
=
av_buffersink_get_format
(
sink
)
;
st
->
codecpar
->
sample_rate
=
link
->
sample_rate
;
st
->
codecpar
->
sample_rate
=
av_buffersink_get_sample_rate
(
sink
)
;
st
->
codecpar
->
channel_layout
=
link
->
channel_layout
;
st
->
codecpar
->
channel_layout
=
av_buffersink_get_channel_layout
(
sink
)
;
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_NONE
)
if
(
st
->
codecpar
->
codec_id
==
AV_CODEC_ID_NONE
)
av_log
(
avctx
,
AV_LOG_ERROR
,
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not find PCM codec for sample format %s.
\n
"
,
"Could not find PCM codec for sample format %s.
\n
"
,
av_get_sample_fmt_name
(
link
->
format
));
av_get_sample_fmt_name
(
av_buffersink_get_format
(
sink
)
));
}
}
}
}
...
@@ -400,7 +401,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
...
@@ -400,7 +401,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
/* iterate through all the graph sinks. Select the sink with the
/* iterate through all the graph sinks. Select the sink with the
* minimum PTS */
* minimum PTS */
for
(
i
=
0
;
i
<
lavfi
->
nb_sinks
;
i
++
)
{
for
(
i
=
0
;
i
<
lavfi
->
nb_sinks
;
i
++
)
{
AVRational
tb
=
lavfi
->
sinks
[
i
]
->
inputs
[
0
]
->
time_base
;
AVRational
tb
=
av_buffersink_get_time_base
(
lavfi
->
sinks
[
i
])
;
double
d
;
double
d
;
int
ret
;
int
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