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
871d0930
Commit
871d0930
authored
Feb 01, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nvenc: support CUDA frames as input
parent
7b3214d0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
238 additions
and
62 deletions
+238
-62
nvenc.c
libavcodec/nvenc.c
+220
-62
nvenc.h
libavcodec/nvenc.h
+18
-0
No files found.
libavcodec/nvenc.c
View file @
871d0930
This diff is collapsed.
Click to expand it.
libavcodec/nvenc.h
View file @
871d0930
...
@@ -29,8 +29,14 @@
...
@@ -29,8 +29,14 @@
#include "avcodec.h"
#include "avcodec.h"
#define MAX_REGISTERED_FRAMES 64
typedef
struct
NVENCFrame
{
typedef
struct
NVENCFrame
{
NV_ENC_INPUT_PTR
in
;
NV_ENC_INPUT_PTR
in
;
AVFrame
*
in_ref
;
NV_ENC_MAP_INPUT_RESOURCE
in_map
;
int
reg_idx
;
NV_ENC_OUTPUT_PTR
out
;
NV_ENC_OUTPUT_PTR
out
;
NV_ENC_BUFFER_FORMAT
format
;
NV_ENC_BUFFER_FORMAT
format
;
int
locked
;
int
locked
;
...
@@ -104,12 +110,24 @@ typedef struct NVENCContext {
...
@@ -104,12 +110,24 @@ typedef struct NVENCContext {
NV_ENC_CONFIG
config
;
NV_ENC_CONFIG
config
;
CUcontext
cu_context
;
CUcontext
cu_context
;
CUcontext
cu_context_internal
;
int
nb_surfaces
;
int
nb_surfaces
;
NVENCFrame
*
frames
;
NVENCFrame
*
frames
;
AVFifoBuffer
*
timestamps
;
AVFifoBuffer
*
timestamps
;
AVFifoBuffer
*
pending
,
*
ready
;
AVFifoBuffer
*
pending
,
*
ready
;
struct
{
CUdeviceptr
ptr
;
NV_ENC_REGISTERED_PTR
regptr
;
int
mapped
;
}
registered_frames
[
MAX_REGISTERED_FRAMES
];
int
nb_registered_frames
;
/* the actual data pixel format, different from
* AVCodecContext.pix_fmt when using hwaccel frames on input */
enum
AVPixelFormat
data_pix_fmt
;
/* timestamps of the first two frames, for computing the first dts
/* timestamps of the first two frames, for computing the first dts
* when b-frames are present */
* when b-frames are present */
int64_t
initial_pts
[
2
];
int64_t
initial_pts
[
2
];
...
...
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