VLC 4.0.0-dev
Loading...
Searching...
No Matches
decoder_prevframe.h
Go to the documentation of this file.
1/*****************************************************************************
2 * decoder_prevframe.h: decoder previous frame helpers
3 *****************************************************************************
4 * Copyright (C) 2025 VLC authors, VideoLAN and Videolabs SAS
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
20
21 #ifndef DECODER_PREVFRAME_H
22 #define DECODER_PREVFRAME_H
23
24#include <limits.h>
25
26#include <vlc_common.h>
27#include <vlc_tick.h>
28#include <vlc_atomic.h>
29#include <vlc_threads.h>
30
31/* Steps as x frames behind displayed pts */
32#define DEC_PF_SEEK_STEPS_NONE INT_MAX
33#define DEC_PF_SEEK_STEPS_INITIAL 1
34#define DEC_PF_SEEK_STEPS_MAX 200
35
36/* Guarded by external lock */
38{
40
41 unsigned req_count;
44 bool failed;
45};
46
47/*
48 * Init previous frame mode (it doesn't enable it)
49 */
50void
52
53/*
54 * Flush lifo (when seeking)
55 */
56void
58
59/*
60 * Reset the previous frame mode (transition to normal playback)
61 */
62void
64
65/*
66 * Request a previous frame
67 */
68void
69decoder_prevframe_Request(struct decoder_prevframe *pf, int *seek_steps);
70
71
72static inline bool
74{
75 return pf->req_count > 0;
76}
77
78/*
79 * Add a picture to the lifo
80 *
81 * @param [inout] inout_pts pointer to the last displayed pts, updated when a
82 * previous frame is found
83 * @param [out] seek_steps pointer to seek request, a seek is requested if
84 * different from DEC_PF_SEEK_STEPS_NONE
85 */
88 vlc_tick_t *inout_pts, int *seek_steps);
89
90#endif /* DECODER_PREVFRAME_H */
void decoder_prevframe_Reset(struct decoder_prevframe *pf)
Definition decoder_prevframe.c:50
void decoder_prevframe_Flush(struct decoder_prevframe *pf)
Definition decoder_prevframe.c:38
static bool decoder_prevframe_IsActive(struct decoder_prevframe *pf)
Definition decoder_prevframe.h:73
picture_t * decoder_prevframe_AddPic(struct decoder_prevframe *pf, picture_t *pic, vlc_tick_t *inout_pts, int *seek_steps)
Definition decoder_prevframe.c:71
void decoder_prevframe_Init(struct decoder_prevframe *pf)
Definition decoder_prevframe.c:28
void decoder_prevframe_Request(struct decoder_prevframe *pf, int *seek_steps)
Definition decoder_prevframe.c:58
Definition decoder_prevframe.h:38
int seek_steps
Definition decoder_prevframe.h:42
bool failed
Definition decoder_prevframe.h:44
picture_t * pic
Definition decoder_prevframe.h:39
bool flushing
Definition decoder_prevframe.h:43
unsigned req_count
Definition decoder_prevframe.h:41
Video picture.
Definition vlc_picture.h:128
Atomic operations do not require locking, but they are not very powerful.
This file is a collection of common definitions and types.
Thread primitive declarations.
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48