Blender V5.3
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
16struct AVFormatContext;
17struct AVCodecContext;
18struct AVCodec;
19struct AVFrame;
20struct AVPacket;
21struct SwsContext;
22
23#ifdef WITH_FFMPEG
24
25extern "C" {
26# include <libavutil/pixfmt.h>
27# include <libavutil/rational.h>
28}
29
30#endif
31
32namespace blender {
33
34struct IDProperty;
35
37 enum class State { Uninitialized, Failed, Valid };
40 int cur_frame_index = 0; /* index 0 = 1e, 1 = 2e, enz. */
42 int frs_sec = 0;
43 double frs_sec_base = 0.0;
44 double start_offset = 0.0;
45 int x = 0;
46 int y = 0;
48
49 /* for number */
50 char filepath[/*FILE_MAX*/ 1024] = {};
51
52 int streamindex = 0;
53
55
56#ifdef WITH_FFMPEG
57 AVFormatContext *format_ctx = nullptr;
58 AVCodecContext *codec_ctx = nullptr;
59 const AVCodec *codec = nullptr;
60 AVFrame *frame_rgb = nullptr;
61 AVFrame *frame_deinterlaced = nullptr;
62 SwsContext *sws_ctx = nullptr;
63 int video_stream_index = 0;
64
65 AVFrame *frame = nullptr;
66 bool frame_complete = false;
67 AVFrame *frame_backup = nullptr;
68 bool frame_backup_complete = false;
69
70 AVFrame *frame_sw = nullptr;
71 AVPixelFormat src_pix_fmt = AV_PIX_FMT_NONE;
72
73 int64_t cur_pts = 0;
74 int64_t cur_key_frame_pts = 0;
75 AVPacket *cur_packet = nullptr;
76
77 AVRational frame_rate = {1, 1};
78
79 bool is_float = false;
80
81 /* When set, never seek within the video, and only ever decode one frame.
82 * This is a workaround for some Ogg files that have full audio but only
83 * one frame of "album art" as a video stream in non-Theora format.
84 * ffmpeg crashes/aborts when trying to seek within them
85 * (https://trac.ffmpeg.org/ticket/10755). */
86 bool never_seek_decode_one_frame = false;
87#endif
88
89 char proxy_dir[768] = {};
90
92
94
95 char colorspace[/*MAX_COLORSPACE_NAME*/ 64] = {};
97 char suffix[/*MAX_NAME*/ 64] = {};
98
99 IDProperty *metadata = nullptr;
100};
101
102} // namespace blender
BMesh Iterators.
__int64 int64_t
Definition BKE_text.h:90
IDProperty * metadata
Definition movie_read.hh:99
MovieReader * proxy_anim[IMB_PROXY_MAX_SLOT]
Definition movie_read.hh:93