Blender  V3.3
IMB_anim.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 #ifdef _WIN32
11 # define INC_OLE2
12 # include <commdlg.h>
13 # include <memory.h>
14 # include <mmsystem.h>
15 # include <vfw.h>
16 # include <windows.h>
17 # include <windowsx.h>
18 
19 # undef AVIIF_KEYFRAME /* redefined in AVI_avi.h */
20 # undef AVIIF_LIST /* redefined in AVI_avi.h */
21 #endif /* _WIN32 */
22 
23 #include <ctype.h>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <sys/types.h>
27 
28 #ifdef _WIN32
29 # include <io.h>
30 #else
31 # include <dirent.h>
32 #endif
33 
34 #include "imbuf.h"
35 
36 #ifdef WITH_AVI
37 # include "AVI_avi.h"
38 #endif
39 
40 #include "IMB_imbuf.h"
41 #include "IMB_imbuf_types.h"
42 
43 #include "IMB_allocimbuf.h"
44 
45 #ifdef WITH_FFMPEG
46 # include <libavcodec/avcodec.h>
47 # include <libavformat/avformat.h>
48 # include <libswscale/swscale.h>
49 #endif
50 
51 /* more endianness... should move to a separate file... */
52 #ifdef __BIG_ENDIAN__
53 # define LITTLE_LONG SWAP_LONG
54 #else
55 # define LITTLE_LONG ENDIAN_NOP
56 #endif
57 
58 /* anim.curtype, runtime only */
59 #define ANIM_NONE 0
60 #define ANIM_SEQUENCE (1 << 0)
61 #define ANIM_MOVIE (1 << 4)
62 #define ANIM_AVI (1 << 6)
63 #define ANIM_FFMPEG (1 << 8)
64 
65 #define MAXNUMSTREAMS 50
66 
67 struct IDProperty;
68 struct _AviMovie;
69 struct anim_index;
70 
71 struct anim {
72  int ib_flags;
73  int curtype;
74  int cur_position; /* index 0 = 1e, 1 = 2e, enz. */
76  int frs_sec;
77  double frs_sec_base;
78  double start_offset;
79  int x, y;
80 
81  /* for number */
82  char name[1024];
83  /* for sequence */
84  char first[1024];
85 
86  /* movie */
87  void *movie;
88  void *track;
89  void *params;
91  size_t framesize;
94 
95  /* avi */
96  struct _AviMovie *avi;
97 
98 #if defined(_WIN32)
99  /* windows avi */
100  int avistreams;
101  int firstvideo;
102  int pfileopen;
103  PAVIFILE pfile;
104  PAVISTREAM pavi[MAXNUMSTREAMS]; /* the current streams */
105  PGETFRAME pgf;
106 #endif
107 
108 #ifdef WITH_FFMPEG
109  AVFormatContext *pFormatCtx;
110  AVCodecContext *pCodecCtx;
111  const AVCodec *pCodec;
112  AVFrame *pFrameRGB;
113  AVFrame *pFrameDeinterlaced;
114  struct SwsContext *img_convert_ctx;
115  int videoStream;
116 
117  AVFrame *pFrame;
118  bool pFrame_complete;
119  AVFrame *pFrame_backup;
120  bool pFrame_backup_complete;
121 
122  struct ImBuf *cur_frame_final;
123  int64_t cur_pts;
124  int64_t cur_key_frame_pts;
125  AVPacket *cur_packet;
126 
127  bool seek_before_decode;
128 #endif
129 
130  char index_dir[768];
131 
134 
137 
138  char colorspace[64];
139  char suffix[64]; /* MAX_NAME - multiview */
140 
142 };
Header file for allocimbuf.c.
#define MAXNUMSTREAMS
Definition: IMB_anim.h:65
@ IMB_PROXY_MAX_SLOT
Definition: IMB_imbuf.h:346
@ IMB_TC_MAX_SLOT
Definition: IMB_imbuf.h:337
Contains defines and structs used throughout the imbuf module.
__int64 int64_t
Definition: stdint.h:89
Definition: IMB_anim.h:71
void * track
Definition: IMB_anim.h:88
int x
Definition: IMB_anim.h:79
int orientation
Definition: IMB_anim.h:90
struct anim_index * curr_idx[IMB_TC_MAX_SLOT]
Definition: IMB_anim.h:136
struct _AviMovie * avi
Definition: IMB_anim.h:96
char first[1024]
Definition: IMB_anim.h:84
double start_offset
Definition: IMB_anim.h:78
int indices_tried
Definition: IMB_anim.h:133
char suffix[64]
Definition: IMB_anim.h:139
char index_dir[768]
Definition: IMB_anim.h:130
void * movie
Definition: IMB_anim.h:87
size_t framesize
Definition: IMB_anim.h:91
int ib_flags
Definition: IMB_anim.h:72
int frs_sec
Definition: IMB_anim.h:76
char colorspace[64]
Definition: IMB_anim.h:138
int interlacing
Definition: IMB_anim.h:92
int duration_in_frames
Definition: IMB_anim.h:75
struct anim * proxy_anim[IMB_PROXY_MAX_SLOT]
Definition: IMB_anim.h:135
struct IDProperty * metadata
Definition: IMB_anim.h:141
int y
Definition: IMB_anim.h:79
void * params
Definition: IMB_anim.h:89
int proxies_tried
Definition: IMB_anim.h:132
int curtype
Definition: IMB_anim.h:73
int streamindex
Definition: IMB_anim.h:93
char name[1024]
Definition: IMB_anim.h:82
double frs_sec_base
Definition: IMB_anim.h:77
int cur_position
Definition: IMB_anim.h:74