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
6f19bbcf
Commit
6f19bbcf
authored
May 21, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qsvdec: move reading the user-provided session to qsv_decode_init()
This is a more appropriate place for it.
parent
e85f6f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
qsvdec.c
libavcodec/qsvdec.c
+11
-13
No files found.
libavcodec/qsvdec.c
View file @
6f19bbcf
...
...
@@ -70,8 +70,9 @@ static int qsv_init_session(AVCodecContext *avctx, QSVContext *q, mfxSession ses
return
0
;
}
static
int
qsv_decode_init
(
AVCodecContext
*
avctx
,
QSVContext
*
q
,
mfxSession
session
)
static
int
qsv_decode_init
(
AVCodecContext
*
avctx
,
QSVContext
*
q
)
{
mfxSession
session
=
NULL
;
mfxVideoParam
param
=
{
{
0
}
};
int
ret
;
...
...
@@ -82,13 +83,20 @@ static int qsv_decode_init(AVCodecContext *avctx, QSVContext *q, mfxSession sess
return
AVERROR
(
ENOMEM
);
}
if
(
avctx
->
hwaccel_context
)
{
AVQSVContext
*
user_ctx
=
avctx
->
hwaccel_context
;
session
=
user_ctx
->
session
;
q
->
iopattern
=
user_ctx
->
iopattern
;
q
->
ext_buffers
=
user_ctx
->
ext_buffers
;
q
->
nb_ext_buffers
=
user_ctx
->
nb_ext_buffers
;
}
ret
=
qsv_init_session
(
avctx
,
q
,
session
);
if
(
ret
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing an MFX session
\n
"
);
return
ret
;
}
ret
=
ff_qsv_codec_id_to_mfx
(
avctx
->
codec_id
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -399,8 +407,6 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
if
(
q
->
parser
->
format
!=
q
->
orig_pix_fmt
||
q
->
parser
->
coded_width
!=
avctx
->
coded_width
||
q
->
parser
->
coded_height
!=
avctx
->
coded_height
)
{
mfxSession
session
=
NULL
;
enum
AVPixelFormat
pix_fmts
[
3
]
=
{
AV_PIX_FMT_QSV
,
AV_PIX_FMT_NONE
,
AV_PIX_FMT_NONE
};
...
...
@@ -429,15 +435,7 @@ int ff_qsv_process_data(AVCodecContext *avctx, QSVContext *q,
avctx
->
pix_fmt
=
ret
;
if
(
avctx
->
hwaccel_context
)
{
AVQSVContext
*
user_ctx
=
avctx
->
hwaccel_context
;
session
=
user_ctx
->
session
;
q
->
iopattern
=
user_ctx
->
iopattern
;
q
->
ext_buffers
=
user_ctx
->
ext_buffers
;
q
->
nb_ext_buffers
=
user_ctx
->
nb_ext_buffers
;
}
ret
=
qsv_decode_init
(
avctx
,
q
,
session
);
ret
=
qsv_decode_init
(
avctx
,
q
);
if
(
ret
<
0
)
goto
reinit_fail
;
}
...
...
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