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
34dfe369
Commit
34dfe369
authored
Jan 06, 2018
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/uncoded_frame: use buffersink accessors.
No longer access buffersink's link structure directly.
parent
b2c42fc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
uncoded_frame.c
tools/uncoded_frame.c
+12
-14
No files found.
tools/uncoded_frame.c
View file @
34dfe369
...
@@ -11,7 +11,6 @@ typedef struct {
...
@@ -11,7 +11,6 @@ typedef struct {
AVFormatContext
*
mux
;
AVFormatContext
*
mux
;
AVStream
*
stream
;
AVStream
*
stream
;
AVFilterContext
*
sink
;
AVFilterContext
*
sink
;
AVFilterLink
*
link
;
}
Stream
;
}
Stream
;
static
int
create_sink
(
Stream
*
st
,
AVFilterGraph
*
graph
,
static
int
create_sink
(
Stream
*
st
,
AVFilterGraph
*
graph
,
...
@@ -36,7 +35,6 @@ static int create_sink(Stream *st, AVFilterGraph *graph,
...
@@ -36,7 +35,6 @@ static int create_sink(Stream *st, AVFilterGraph *graph,
ret
=
avfilter_link
(
f
,
idx
,
st
->
sink
,
0
);
ret
=
avfilter_link
(
f
,
idx
,
st
->
sink
,
0
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
st
->
link
=
st
->
sink
->
inputs
[
0
];
return
0
;
return
0
;
}
}
...
@@ -163,24 +161,24 @@ int main(int argc, char **argv)
...
@@ -163,24 +161,24 @@ int main(int argc, char **argv)
av_log
(
NULL
,
AV_LOG_ERROR
,
"Failed to create output stream
\n
"
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"Failed to create output stream
\n
"
);
goto
fail
;
goto
fail
;
}
}
st
->
stream
->
codec
->
codec_type
=
st
->
link
->
type
;
st
->
stream
->
codec
->
codec_type
=
av_buffersink_get_type
(
st
->
sink
)
;
st
->
stream
->
time_base
=
st
->
stream
->
codec
->
time_base
=
st
->
stream
->
time_base
=
st
->
stream
->
codec
->
time_base
=
st
->
link
->
time_base
;
av_buffersink_get_time_base
(
st
->
sink
)
;
switch
(
st
->
link
->
type
)
{
switch
(
av_buffersink_get_type
(
st
->
sink
)
)
{
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
st
->
stream
->
codec
->
codec_id
=
AV_CODEC_ID_RAWVIDEO
;
st
->
stream
->
codec
->
codec_id
=
AV_CODEC_ID_RAWVIDEO
;
st
->
stream
->
avg_frame_rate
=
st
->
stream
->
avg_frame_rate
=
st
->
stream
->
r_frame_rate
=
av_buffersink_get_frame_rate
(
st
->
sink
);
st
->
stream
->
r_frame_rate
=
av_buffersink_get_frame_rate
(
st
->
sink
);
st
->
stream
->
codec
->
width
=
st
->
link
->
w
;
st
->
stream
->
codec
->
width
=
av_buffersink_get_w
(
st
->
sink
)
;
st
->
stream
->
codec
->
height
=
st
->
link
->
h
;
st
->
stream
->
codec
->
height
=
av_buffersink_get_h
(
st
->
sink
)
;
st
->
stream
->
codec
->
sample_aspect_ratio
=
st
->
link
->
sample_aspect_ratio
;
st
->
stream
->
codec
->
sample_aspect_ratio
=
av_buffersink_get_sample_aspect_ratio
(
st
->
sink
)
;
st
->
stream
->
codec
->
pix_fmt
=
st
->
link
->
format
;
st
->
stream
->
codec
->
pix_fmt
=
av_buffersink_get_format
(
st
->
sink
)
;
break
;
break
;
case
AVMEDIA_TYPE_AUDIO
:
case
AVMEDIA_TYPE_AUDIO
:
st
->
stream
->
codec
->
channel_layout
=
st
->
link
->
channel_layout
;
st
->
stream
->
codec
->
channel_layout
=
av_buffersink_get_channel_layout
(
st
->
sink
)
;
st
->
stream
->
codec
->
channels
=
avfilter_link_get_channels
(
st
->
l
ink
);
st
->
stream
->
codec
->
channels
=
av_buffersink_get_channels
(
st
->
s
ink
);
st
->
stream
->
codec
->
sample_rate
=
st
->
link
->
sample_rate
;
st
->
stream
->
codec
->
sample_rate
=
av_buffersink_get_sample_rate
(
st
->
sink
)
;
st
->
stream
->
codec
->
sample_fmt
=
st
->
link
->
format
;
st
->
stream
->
codec
->
sample_fmt
=
av_buffersink_get_format
(
st
->
sink
)
;
st
->
stream
->
codec
->
codec_id
=
st
->
stream
->
codec
->
codec_id
=
av_get_pcm_codec
(
st
->
stream
->
codec
->
sample_fmt
,
-
1
);
av_get_pcm_codec
(
st
->
stream
->
codec
->
sample_fmt
,
-
1
);
break
;
break
;
...
@@ -240,7 +238,7 @@ int main(int argc, char **argv)
...
@@ -240,7 +238,7 @@ int main(int argc, char **argv)
}
}
if
(
frame
->
pts
!=
AV_NOPTS_VALUE
)
if
(
frame
->
pts
!=
AV_NOPTS_VALUE
)
frame
->
pts
=
av_rescale_q
(
frame
->
pts
,
frame
->
pts
=
av_rescale_q
(
frame
->
pts
,
st
->
link
->
time_base
,
av_buffersink_get_time_base
(
st
->
sink
)
,
st
->
stream
->
time_base
);
st
->
stream
->
time_base
);
ret
=
av_interleaved_write_uncoded_frame
(
st
->
mux
,
ret
=
av_interleaved_write_uncoded_frame
(
st
->
mux
,
st
->
stream
->
index
,
st
->
stream
->
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