FFmpeg
Loading...
Searching...
No Matches
libavcodec
tests
hw_base_encode.c
Go to the documentation of this file.
1
/*
2
* This file is part of FFmpeg.
3
*
4
* FFmpeg is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* FFmpeg is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with FFmpeg; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
#include <stdio.h>
20
21
#include "
libavcodec/hw_base_encode.c
"
22
23
int
main
(
void
)
24
{
25
AVCodecContext
avctx = { 0 };
26
27
for
(
int
delay = 0; delay <= 3; delay++) {
28
for
(
int
count = 0; count <= 4; count++) {
29
FFHWBaseEncodePicture
pic = { 0 };
30
FFHWBaseEncodeContext
ctx
= { 0 };
31
int
ret
;
32
33
ctx
.decode_delay = delay;
34
ctx
.input_order = count;
35
ctx
.first_pts = 100;
36
if
(count) {
37
pic.
pts
=
ctx
.first_pts + 10 * (count - 1);
38
ctx
.pic_end = &pic;
39
}
40
if
(count > delay)
41
ctx
.dts_pts_diff = 10 * delay;
42
43
ret
=
hw_base_encode_send_frame
(&avctx, &
ctx
,
NULL
);
44
printf
(
"delay=%d frames=%d return=%d eof=%d pts_diff=%"
PRId64
"\n"
,
45
delay, count,
ret
,
ctx
.end_of_stream,
ctx
.dts_pts_diff);
46
}
47
}
48
return
0;
49
}
ctx
static AVFormatContext * ctx
Definition
api-movenc-test.c:49
NULL
#define NULL
Definition
coverity.c:32
printf
__device__ int printf(const char *,...)
ret
int ret
Definition
ffplay.c:391
hw_base_encode.c
hw_base_encode_send_frame
static int hw_base_encode_send_frame(AVCodecContext *avctx, FFHWBaseEncodeContext *ctx, AVFrame *frame)
Definition
hw_base_encode.c:420
AVCodecContext
main external API structure.
Definition
avcodec.h:443
FFHWBaseEncodeContext
Definition
hw_base_encode.h:125
FFHWBaseEncodePicture
Definition
hw_base_encode.h:64
FFHWBaseEncodePicture::pts
int64_t pts
Definition
hw_base_encode.h:74
main
int main(void)
Definition
hw_base_encode.c:23
Generated on Sat Nov 14 2026 19:20:58 for FFmpeg by
1.13.2