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
632ad224
Commit
632ad224
authored
Mar 06, 2014
by
Anton Khirnov
Committed by
Luca Barbato
May 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: Add an internal wrapper around get_format()
It will be useful in the following commits.
parent
9880a0d4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
10 deletions
+22
-10
8bps.c
libavcodec/8bps.c
+1
-1
h263dec.c
libavcodec/h263dec.c
+1
-1
h264_slice.c
libavcodec/h264_slice.c
+5
-5
internal.h
libavcodec/internal.h
+7
-0
mpeg12dec.c
libavcodec/mpeg12dec.c
+2
-2
utils.c
libavcodec/utils.c
+5
-0
vc1dec.c
libavcodec/vc1dec.c
+1
-1
No files found.
libavcodec/8bps.c
View file @
632ad224
...
@@ -159,7 +159,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -159,7 +159,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c
->
planemap
[
0
]
=
0
;
// 1st plane is palette indexes
c
->
planemap
[
0
]
=
0
;
// 1st plane is palette indexes
break
;
break
;
case
24
:
case
24
:
avctx
->
pix_fmt
=
avctx
->
get_format
(
avctx
,
pixfmt_rgb24
);
avctx
->
pix_fmt
=
ff_
get_format
(
avctx
,
pixfmt_rgb24
);
c
->
planes
=
3
;
c
->
planes
=
3
;
c
->
planemap
[
0
]
=
2
;
// 1st plane is red
c
->
planemap
[
0
]
=
2
;
// 1st plane is red
c
->
planemap
[
1
]
=
1
;
// 2nd plane is green
c
->
planemap
[
1
]
=
1
;
// 2nd plane is green
...
...
libavcodec/h263dec.c
View file @
632ad224
...
@@ -57,7 +57,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
...
@@ -57,7 +57,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_MSS2
)
if
(
avctx
->
codec
->
id
==
AV_CODEC_ID_MSS2
)
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
else
else
avctx
->
pix_fmt
=
avctx
->
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
avctx
->
pix_fmt
=
ff_
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
s
->
unrestricted_mv
=
1
;
s
->
unrestricted_mv
=
1
;
/* select sub codec */
/* select sub codec */
...
...
libavcodec/h264_slice.c
View file @
632ad224
...
@@ -1008,11 +1008,11 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
...
@@ -1008,11 +1008,11 @@ static enum AVPixelFormat get_pixel_format(H264Context *h)
return
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
AV_PIX_FMT_YUVJ422P
return
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
AV_PIX_FMT_YUVJ422P
:
AV_PIX_FMT_YUV422P
;
:
AV_PIX_FMT_YUV422P
;
}
else
{
}
else
{
return
h
->
avctx
->
get_format
(
h
->
avctx
,
h
->
avctx
->
codec
->
pix_fmts
?
return
ff_
get_format
(
h
->
avctx
,
h
->
avctx
->
codec
->
pix_fmts
?
h
->
avctx
->
codec
->
pix_fmts
:
h
->
avctx
->
codec
->
pix_fmts
:
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
h
->
avctx
->
color_range
==
AVCOL_RANGE_JPEG
?
h264_hwaccel_pixfmt_list_jpeg_420
:
h264_hwaccel_pixfmt_list_jpeg_420
:
h264_hwaccel_pixfmt_list_420
);
h264_hwaccel_pixfmt_list_420
);
}
}
break
;
break
;
default:
default:
...
...
libavcodec/internal.h
View file @
632ad224
...
@@ -186,6 +186,13 @@ int ff_set_dimensions(AVCodecContext *s, int width, int height);
...
@@ -186,6 +186,13 @@ int ff_set_dimensions(AVCodecContext *s, int width, int height);
int
ff_side_data_update_matrix_encoding
(
AVFrame
*
frame
,
int
ff_side_data_update_matrix_encoding
(
AVFrame
*
frame
,
enum
AVMatrixEncoding
matrix_encoding
);
enum
AVMatrixEncoding
matrix_encoding
);
/**
* Select the (possibly hardware accelerated) pixel format.
* This is a wrapper around AVCodecContext.get_format() and should be used
* instead of calling get_format() directly.
*/
int
ff_get_format
(
AVCodecContext
*
avctx
,
const
enum
AVPixelFormat
*
fmt
);
/**
/**
* Set various frame properties from the codec context / packet data.
* Set various frame properties from the codec context / packet data.
*/
*/
...
...
libavcodec/mpeg12dec.c
View file @
632ad224
...
@@ -1188,12 +1188,12 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
...
@@ -1188,12 +1188,12 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
#if FF_API_XVMC
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
FF_DISABLE_DEPRECATION_WARNINGS
if
(
avctx
->
xvmc_acceleration
)
if
(
avctx
->
xvmc_acceleration
)
return
avctx
->
get_format
(
avctx
,
pixfmt_xvmc_mpg2_420
);
return
ff_
get_format
(
avctx
,
pixfmt_xvmc_mpg2_420
);
FF_ENABLE_DEPRECATION_WARNINGS
FF_ENABLE_DEPRECATION_WARNINGS
#endif
/* FF_API_XVMC */
#endif
/* FF_API_XVMC */
if
(
s
->
chroma_format
<
2
)
if
(
s
->
chroma_format
<
2
)
return
avctx
->
get_format
(
avctx
,
mpeg12_hwaccel_pixfmt_list_420
);
return
ff_
get_format
(
avctx
,
mpeg12_hwaccel_pixfmt_list_420
);
else
if
(
s
->
chroma_format
==
2
)
else
if
(
s
->
chroma_format
==
2
)
return
AV_PIX_FMT_YUV422P
;
return
AV_PIX_FMT_YUV422P
;
else
else
...
...
libavcodec/utils.c
View file @
632ad224
...
@@ -864,6 +864,11 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const en
...
@@ -864,6 +864,11 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const en
return
fmt
[
0
];
return
fmt
[
0
];
}
}
int
ff_get_format
(
AVCodecContext
*
avctx
,
const
enum
AVPixelFormat
*
fmt
)
{
return
avctx
->
get_format
(
avctx
,
fmt
);
}
#if FF_API_AVFRAME_LAVC
#if FF_API_AVFRAME_LAVC
void
avcodec_get_frame_defaults
(
AVFrame
*
frame
)
void
avcodec_get_frame_defaults
(
AVFrame
*
frame
)
{
{
...
...
libavcodec/vc1dec.c
View file @
632ad224
...
@@ -5595,7 +5595,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
...
@@ -5595,7 +5595,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
if
(
!
avctx
->
extradata_size
||
!
avctx
->
extradata
)
if
(
!
avctx
->
extradata_size
||
!
avctx
->
extradata
)
return
-
1
;
return
-
1
;
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_GRAY
))
if
(
!
(
avctx
->
flags
&
CODEC_FLAG_GRAY
))
avctx
->
pix_fmt
=
avctx
->
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
avctx
->
pix_fmt
=
ff_
get_format
(
avctx
,
avctx
->
codec
->
pix_fmts
);
else
else
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
avctx
->
pix_fmt
=
AV_PIX_FMT_GRAY8
;
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
);
avctx
->
hwaccel
=
ff_find_hwaccel
(
avctx
);
...
...
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