FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvdec.h
Go to the documentation of this file.
1 /*
2  * HW decode acceleration through NVDEC
3  *
4  * Copyright (c) 2016 Anton Khirnov
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_NVDEC_H
24 #define AVCODEC_NVDEC_H
25 
27 
28 #include <stdint.h>
29 
30 #include "libavutil/buffer.h"
31 #include "libavutil/frame.h"
32 
33 #include "avcodec.h"
34 
35 typedef struct NVDECFrame {
36  unsigned int idx;
39 } NVDECFrame;
40 
41 typedef struct NVDECContext {
43 
45 
47 
50  unsigned int bitstream_allocated;
51 
52  unsigned *slice_offsets;
53  int nb_slices;
55 } NVDECContext;
56 
63  uint32_t size);
65  AVBufferRef *hw_frames_ctx,
66  int dpb_size);
68 
69 #endif /* AVCODEC_NVDEC_H */
AVBufferRef * decoder_ref
Definition: nvdec.h:38
This structure describes decoded (raw) audio or video data.
Definition: frame.h:201
int ff_nvdec_decode_uninit(AVCodecContext *avctx)
Definition: nvdec.c:245
unsigned * slice_offsets
Definition: nvdec.h:52
int nb_slices
Definition: nvdec.h:53
uint8_t * bitstream
Definition: nvdec.h:48
int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
Definition: nvdec.c:501
uint8_t
CUVIDPICPARAMS pic_params
Definition: nvdec.h:42
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size)
Definition: nvdec.c:523
int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame)
Definition: nvdec.c:417
static AVFrame * frame
AVBufferRef * decoder_ref
Definition: nvdec.h:46
ptrdiff_t size
Definition: opengl_enc.c:101
The buffer pool.
Picture parameters for decoding This structure is used in cuvidDecodePicture API IN for cuvidDecodePi...
unsigned int idx
Definition: nvdec.h:36
int ff_nvdec_end_frame(AVCodecContext *avctx)
Definition: nvdec.c:459
reference-counted frame API
int bitstream_len
Definition: nvdec.h:49
Libavcodec external API header.
unsigned int bitstream_allocated
Definition: nvdec.h:50
main external API structure.
Definition: avcodec.h:1488
int ff_nvdec_decode_init(AVCodecContext *avctx)
Definition: nvdec.c:263
unsigned int slice_offsets_allocated
Definition: nvdec.h:54
refcounted data buffer API
AVBufferRef * idx_ref
Definition: nvdec.h:37
A reference to a data buffer.
Definition: buffer.h:81
AVBufferPool * decoder_pool
Definition: nvdec.h:44
int ff_nvdec_simple_end_frame(AVCodecContext *avctx)
Definition: nvdec.c:493
int ff_nvdec_get_ref_idx(AVFrame *frame)
Definition: nvdec.c:569
GLuint buffer
Definition: opengl_enc.c:102