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
758f929d
Commit
758f929d
authored
Jun 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: Fix choose_pixel_fmt() so it uses the correct encoding context
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
00dcb106
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
ffmpeg.h
ffmpeg.h
+1
-1
ffmpeg_filter.c
ffmpeg_filter.c
+5
-5
ffmpeg_opt.c
ffmpeg_opt.c
+1
-1
No files found.
ffmpeg.h
View file @
758f929d
...
@@ -503,7 +503,7 @@ void assert_avoptions(AVDictionary *m);
...
@@ -503,7 +503,7 @@ void assert_avoptions(AVDictionary *m);
int
guess_input_channel_layout
(
InputStream
*
ist
);
int
guess_input_channel_layout
(
InputStream
*
ist
);
enum
AVPixelFormat
choose_pixel_fmt
(
AVStream
*
st
,
AVCodec
*
codec
,
enum
AVPixelFormat
target
);
enum
AVPixelFormat
choose_pixel_fmt
(
AVStream
*
st
,
AVCodec
Context
*
avctx
,
AVCodec
*
codec
,
enum
AVPixelFormat
target
);
void
choose_sample_fmt
(
AVStream
*
st
,
AVCodec
*
codec
);
void
choose_sample_fmt
(
AVStream
*
st
,
AVCodec
*
codec
);
int
configure_filtergraph
(
FilterGraph
*
fg
);
int
configure_filtergraph
(
FilterGraph
*
fg
);
...
...
ffmpeg_filter.c
View file @
758f929d
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/samplefmt.h"
enum
AVPixelFormat
choose_pixel_fmt
(
AVStream
*
st
,
AVCodec
*
codec
,
enum
AVPixelFormat
target
)
enum
AVPixelFormat
choose_pixel_fmt
(
AVStream
*
st
,
AVCodec
Context
*
enc_ctx
,
AVCodec
*
codec
,
enum
AVPixelFormat
target
)
{
{
if
(
codec
&&
codec
->
pix_fmts
)
{
if
(
codec
&&
codec
->
pix_fmts
)
{
const
enum
AVPixelFormat
*
p
=
codec
->
pix_fmts
;
const
enum
AVPixelFormat
*
p
=
codec
->
pix_fmts
;
...
@@ -50,10 +50,10 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
...
@@ -50,10 +50,10 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
{
AV_PIX_FMT_YUVJ420P
,
AV_PIX_FMT_YUVJ422P
,
AV_PIX_FMT_YUVJ444P
,
AV_PIX_FMT_YUV420P
,
{
AV_PIX_FMT_YUVJ420P
,
AV_PIX_FMT_YUVJ422P
,
AV_PIX_FMT_YUVJ444P
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_BGRA
,
AV_PIX_FMT_NONE
};
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_BGRA
,
AV_PIX_FMT_NONE
};
if
(
st
->
codec
->
strict_std_compliance
<=
FF_COMPLIANCE_UNOFFICIAL
)
{
if
(
enc_ctx
->
strict_std_compliance
<=
FF_COMPLIANCE_UNOFFICIAL
)
{
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_MJPEG
)
{
if
(
enc_ctx
->
codec_id
==
AV_CODEC_ID_MJPEG
)
{
p
=
mjpeg_formats
;
p
=
mjpeg_formats
;
}
else
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_LJPEG
)
{
}
else
if
(
enc_ctx
->
codec_id
==
AV_CODEC_ID_LJPEG
)
{
p
=
ljpeg_formats
;
p
=
ljpeg_formats
;
}
}
}
}
...
@@ -113,7 +113,7 @@ static char *choose_pix_fmts(OutputStream *ost)
...
@@ -113,7 +113,7 @@ static char *choose_pix_fmts(OutputStream *ost)
return
av_strdup
(
av_get_pix_fmt_name
(
ost
->
enc_ctx
->
pix_fmt
));
return
av_strdup
(
av_get_pix_fmt_name
(
ost
->
enc_ctx
->
pix_fmt
));
}
}
if
(
ost
->
enc_ctx
->
pix_fmt
!=
AV_PIX_FMT_NONE
)
{
if
(
ost
->
enc_ctx
->
pix_fmt
!=
AV_PIX_FMT_NONE
)
{
return
av_strdup
(
av_get_pix_fmt_name
(
choose_pixel_fmt
(
ost
->
st
,
ost
->
enc
,
ost
->
enc_ctx
->
pix_fmt
)));
return
av_strdup
(
av_get_pix_fmt_name
(
choose_pixel_fmt
(
ost
->
st
,
ost
->
enc
_ctx
,
ost
->
enc
,
ost
->
enc_ctx
->
pix_fmt
)));
}
else
if
(
ost
->
enc
&&
ost
->
enc
->
pix_fmts
)
{
}
else
if
(
ost
->
enc
&&
ost
->
enc
->
pix_fmts
)
{
const
enum
AVPixelFormat
*
p
;
const
enum
AVPixelFormat
*
p
;
AVIOContext
*
s
=
NULL
;
AVIOContext
*
s
=
NULL
;
...
...
ffmpeg_opt.c
View file @
758f929d
...
@@ -1631,7 +1631,7 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
...
@@ -1631,7 +1631,7 @@ static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const ch
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
&&
!
ost
->
stream_copy
)
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
&&
!
ost
->
stream_copy
)
choose_sample_fmt
(
st
,
codec
);
choose_sample_fmt
(
st
,
codec
);
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
!
ost
->
stream_copy
)
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
!
ost
->
stream_copy
)
choose_pixel_fmt
(
st
,
codec
,
st
->
codec
->
pix_fmt
);
choose_pixel_fmt
(
st
,
st
->
codec
,
codec
,
st
->
codec
->
pix_fmt
);
}
}
avformat_close_input
(
&
ic
);
avformat_close_input
(
&
ic
);
...
...
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