Blender V5.0
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
52
53#ifdef WITH_FFMPEG
54 AVFormatContext *pFormatCtx = nullptr;
55 AVCodecContext *pCodecCtx = nullptr;
56 const AVCodec *pCodec = nullptr;
57 AVFrame *pFrameRGB = nullptr;
58 AVFrame *pFrameDeinterlaced = nullptr;
59 SwsContext *img_convert_ctx = nullptr;
60 int videoStream = 0;
61
62 AVFrame *pFrame = nullptr;
63 bool pFrame_complete = false;
64 AVFrame *pFrame_backup = nullptr;
65 bool pFrame_backup_complete = false;
66
67 int64_t cur_pts = 0;
68 int64_t cur_key_frame_pts = 0;
69 AVPacket *cur_packet = nullptr;
70
71 AVRational frame_rate = {1, 1};
72
73 bool seek_before_decode = false;
74 bool is_float = false;
75
76 /* When set, never seek within the video, and only ever decode one frame.
77 * This is a workaround for some Ogg files that have full audio but only
78 * one frame of "album art" as a video stream in non-Theora format.
79 * ffmpeg crashes/aborts when trying to seek within them
80 * (https://trac.ffmpeg.org/ticket/10755). */
81 bool never_seek_decode_one_frame = false;
82#endif
83
84 char index_dir[768] = {};
85
88
91 MovieIndex *no_gaps = nullptr;
92
93 char colorspace[/*MAX_COLORSPACE_NAME*/ 64] = {};
95 char suffix[/*MAX_NAME*/ 64] = {};
96
97 IDProperty *metadata = nullptr;
98};
@ IMB_PROXY_MAX_SLOT
long long int int64_t
char colorspace[64]
Definition movie_read.hh:93
MovieReader * proxy_anim[IMB_PROXY_MAX_SLOT]
Definition movie_read.hh:89
double start_offset
Definition movie_read.hh:41
MovieIndex * record_run
Definition movie_read.hh:90
MovieIndex * no_gaps
Definition movie_read.hh:91
char index_dir[768]
Definition movie_read.hh:84
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:87
char suffix[64]
Definition movie_read.hh:95
IDProperty * metadata
Definition movie_read.hh:97
int video_rotation
Definition movie_read.hh:44
int proxies_tried
Definition movie_read.hh:86
bool keep_original_colorspace
Definition movie_read.hh:51