Blender  V2.93
IMB_anim.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #ifdef _WIN32
27 # define INC_OLE2
28 # include <commdlg.h>
29 # include <memory.h>
30 # include <mmsystem.h>
31 # include <vfw.h>
32 # include <windows.h>
33 # include <windowsx.h>
34 
35 # undef AVIIF_KEYFRAME /* redefined in AVI_avi.h */
36 # undef AVIIF_LIST /* redefined in AVI_avi.h */
37 #endif /* _WIN32 */
38 
39 #include <ctype.h>
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <sys/types.h>
43 
44 #ifdef _WIN32
45 # include <io.h>
46 #else
47 # include <dirent.h>
48 #endif
49 
50 #include "imbuf.h"
51 
52 #ifdef WITH_AVI
53 # include "AVI_avi.h"
54 #endif
55 
56 #include "IMB_imbuf.h"
57 #include "IMB_imbuf_types.h"
58 
59 #include "IMB_allocimbuf.h"
60 
61 #ifdef WITH_FFMPEG
62 # include <libavcodec/avcodec.h>
63 # include <libavformat/avformat.h>
64 # include <libswscale/swscale.h>
65 #endif
66 
67 /* more endianness... should move to a separate file... */
68 #ifdef __BIG_ENDIAN__
69 # define LITTLE_LONG SWAP_LONG
70 #else
71 # define LITTLE_LONG ENDIAN_NOP
72 #endif
73 
74 /* anim.curtype, runtime only */
75 #define ANIM_NONE 0
76 #define ANIM_SEQUENCE (1 << 0)
77 #define ANIM_MOVIE (1 << 4)
78 #define ANIM_AVI (1 << 6)
79 #define ANIM_FFMPEG (1 << 8)
80 
81 #define MAXNUMSTREAMS 50
82 
83 struct IDProperty;
84 struct _AviMovie;
85 struct anim_index;
86 
87 struct anim {
88  int ib_flags;
89  int curtype;
90  int cur_position; /* index 0 = 1e, 1 = 2e, enz. */
92  int frs_sec;
93  double frs_sec_base;
94  double start_offset;
95  int x, y;
96 
97  /* for number */
98  char name[1024];
99  /* for sequence */
100  char first[1024];
101 
102  /* movie */
103  void *movie;
104  void *track;
105  void *params;
107  size_t framesize;
110 
111  /* avi */
112  struct _AviMovie *avi;
113 
114 #if defined(_WIN32)
115  /* windows avi */
116  int avistreams;
117  int firstvideo;
118  int pfileopen;
119  PAVIFILE pfile;
120  PAVISTREAM pavi[MAXNUMSTREAMS]; /* the current streams */
121  PGETFRAME pgf;
122 #endif
123 
124 #ifdef WITH_FFMPEG
125  AVFormatContext *pFormatCtx;
126  AVCodecContext *pCodecCtx;
127  AVCodec *pCodec;
128  AVFrame *pFrame;
129  int pFrameComplete;
130  AVFrame *pFrameRGB;
131  AVFrame *pFrameDeinterlaced;
132  struct SwsContext *img_convert_ctx;
133  int videoStream;
134 
135  struct ImBuf *cur_frame_final;
136  int64_t cur_pts;
137  int64_t cur_key_frame_pts;
138  AVPacket *cur_packet;
139 #endif
140 
141  char index_dir[768];
142 
145 
148 
149  char colorspace[64];
150  char suffix[64]; /* MAX_NAME - multiview */
151 
153 };
Header file for allocimbuf.c.
#define MAXNUMSTREAMS
Definition: IMB_anim.h:81
@ IMB_PROXY_MAX_SLOT
Definition: IMB_imbuf.h:323
@ IMB_TC_MAX_SLOT
Definition: IMB_imbuf.h:314
Contains defines and structs used throughout the imbuf module.
__int64 int64_t
Definition: stdint.h:92
Definition: IMB_anim.h:87
void * track
Definition: IMB_anim.h:104
int x
Definition: IMB_anim.h:95
int orientation
Definition: IMB_anim.h:106
struct anim_index * curr_idx[IMB_TC_MAX_SLOT]
Definition: IMB_anim.h:147
struct _AviMovie * avi
Definition: IMB_anim.h:112
char first[1024]
Definition: IMB_anim.h:100
double start_offset
Definition: IMB_anim.h:94
int indices_tried
Definition: IMB_anim.h:144
char suffix[64]
Definition: IMB_anim.h:150
char index_dir[768]
Definition: IMB_anim.h:141
void * movie
Definition: IMB_anim.h:103
size_t framesize
Definition: IMB_anim.h:107
int ib_flags
Definition: IMB_anim.h:88
int frs_sec
Definition: IMB_anim.h:92
char colorspace[64]
Definition: IMB_anim.h:149
int interlacing
Definition: IMB_anim.h:108
int duration_in_frames
Definition: IMB_anim.h:91
struct anim * proxy_anim[IMB_PROXY_MAX_SLOT]
Definition: IMB_anim.h:146
struct IDProperty * metadata
Definition: IMB_anim.h:152
int y
Definition: IMB_anim.h:95
void * params
Definition: IMB_anim.h:105
int proxies_tried
Definition: IMB_anim.h:143
int curtype
Definition: IMB_anim.h:89
int streamindex
Definition: IMB_anim.h:109
char name[1024]
Definition: IMB_anim.h:98
double frs_sec_base
Definition: IMB_anim.h:93
int cur_position
Definition: IMB_anim.h:90