Blender V4.5
movie_read.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 * SPDX-FileCopyrightText: 2024-2025 Blender Authors
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later */
5
9
10#pragma once
11
12#include <cstdint>
13
14#include "IMB_imbuf_enums.h"
15
16#ifdef WITH_FFMPEG
17
18extern "C" {
19# include <libavutil/rational.h>
20}
21
22struct AVFormatContext;
23struct AVCodecContext;
24struct AVCodec;
25struct AVFrame;
26struct AVPacket;
27struct SwsContext;
28#endif
29
30struct IDProperty;
31struct MovieIndex;
32
34 enum class State { Uninitialized, Failed, Valid };
35 int ib_flags = 0;
37 int cur_position = 0; /* index 0 = 1e, 1 = 2e, enz. */
39 int frs_sec = 0;
40 double frs_sec_base = 0.0;
41 double start_offset = 0.0;
42 int x = 0;
43 int y = 0;
45
46 /* for number */
47 char filepath[1024] = {};
48
49 int streamindex = 0;
50
51#ifdef WITH_FFMPEG
52 AVFormatContext *pFormatCtx = nullptr;
53 AVCodecContext *pCodecCtx = nullptr;
54 const AVCodec *pCodec = nullptr;
55 AVFrame *pFrameRGB = nullptr;
56 AVFrame *pFrameDeinterlaced = nullptr;
57 SwsContext *img_convert_ctx = nullptr;
58 int videoStream = 0;
59
60 AVFrame *pFrame = nullptr;
61 bool pFrame_complete = false;
62 AVFrame *pFrame_backup = nullptr;
63 bool pFrame_backup_complete = false;
64
65 int64_t cur_pts = 0;
66 int64_t cur_key_frame_pts = 0;
67 AVPacket *cur_packet = nullptr;
68
69 AVRational frame_rate = {1, 1};
70
71 bool seek_before_decode = false;
72 bool is_float = false;
73
74 /* When set, never seek within the video, and only ever decode one frame.
75 * This is a workaround for some Ogg files that have full audio but only
76 * one frame of "album art" as a video stream in non-Theora format.
77 * ffmpeg crashes/aborts when trying to seek within them
78 * (https://trac.ffmpeg.org/ticket/10755). */
79 bool never_seek_decode_one_frame = false;
80#endif
81
82 char index_dir[768] = {};
83
86
89 MovieIndex *no_gaps = nullptr;
90
91 char colorspace[64] = {};
92 char suffix[64] = {}; /* MAX_NAME - multiview */
93
94 IDProperty *metadata = nullptr;
95};
@ IMB_PROXY_MAX_SLOT
long long int int64_t
char colorspace[64]
Definition movie_read.hh:91
MovieReader * proxy_anim[IMB_PROXY_MAX_SLOT]
Definition movie_read.hh:87
double start_offset
Definition movie_read.hh:41
MovieIndex * record_run
Definition movie_read.hh:88
MovieIndex * no_gaps
Definition movie_read.hh:89
char index_dir[768]
Definition movie_read.hh:82
double frs_sec_base
Definition movie_read.hh:40
char filepath[1024]
Definition movie_read.hh:47
int duration_in_frames
Definition movie_read.hh:38
int indices_tried
Definition movie_read.hh:85
char suffix[64]
Definition movie_read.hh:92
IDProperty * metadata
Definition movie_read.hh:94
int video_rotation
Definition movie_read.hh:44
int proxies_tried
Definition movie_read.hh:84