Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IMB_anim.h « intern « imbuf « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 690ec8134071182c023849dc84f85fea128964af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
 * All rights reserved.
 *
 * The Original Code is: all of this file.
 *
 * Contributor(s): none yet.
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/** \file blender/imbuf/intern/IMB_anim.h
 *  \ingroup imbuf
 */


#ifndef __IMB_ANIM_H__
#define __IMB_ANIM_H__

#ifdef _WIN32
#  define INC_OLE2
#  include <windows.h>
#  include <windowsx.h>
#  include <mmsystem.h>
#  include <memory.h>
#  include <commdlg.h>

#  ifndef FREE_WINDOWS
#    include <vfw.h>
#  endif

#  undef AVIIF_KEYFRAME // redefined in AVI_avi.h
#  undef AVIIF_LIST // redefined in AVI_avi.h
#endif /* _WIN32 */

#include <sys/types.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>

#ifdef _WIN32
#  include <io.h>
#else
#  include <dirent.h>
#endif

#include "imbuf.h"

#ifdef WITH_AVI
#  include "AVI_avi.h"
#endif

#ifdef WITH_QUICKTIME
#  if defined(_WIN32) || defined(__APPLE__)
#    include "quicktime_import.h"
#  endif /* _WIN32 || __APPLE__ */
#endif /* WITH_QUICKTIME */

#ifdef WITH_FFMPEG
#  include <libavformat/avformat.h>
#  include <libavcodec/avcodec.h>
#  include <libswscale/swscale.h>
#endif

#ifdef WITH_REDCODE
#  include "libredcode/format.h"
#endif

#include "IMB_imbuf_types.h"
#include "IMB_imbuf.h"

#include "IMB_allocimbuf.h"



/* actually hard coded endianness */
#define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3])
#define GET_LITTLE_LONG(x) (((uchar *) (x))[3] << 24 | ((uchar *) (x))[2] << 16 | ((uchar *) (x))[1] << 8 | ((uchar *) (x))[0])
#define SWAP_L(x) (((x << 24) & 0xff000000) | ((x << 8) & 0xff0000) | ((x >> 8) & 0xff00) | ((x >> 24) & 0xff))
#define SWAP_S(x) (((x << 8) & 0xff00) | ((x >> 8) & 0xff))

/* more endianness... should move to a separate file... */
#ifdef __BIG_ENDIAN__
#  define GET_ID GET_BIG_LONG
#  define LITTLE_LONG SWAP_LONG
#else
#  define GET_ID GET_LITTLE_LONG
#  define LITTLE_LONG ENDIAN_NOP
#endif

/* anim.curtype, runtime only */
#define ANIM_NONE       0
#define ANIM_SEQUENCE   (1 << 0)
#define ANIM_MOVIE      (1 << 4)
#define ANIM_AVI        (1 << 6)
#define ANIM_QTIME      (1 << 7)
#define ANIM_FFMPEG     (1 << 8)
#define ANIM_REDCODE    (1 << 9)

#define MAXNUMSTREAMS       50

struct _AviMovie;
struct anim_index;

struct anim {
	int ib_flags;
	int curtype;
	int curposition;    /* index  0 = 1e,  1 = 2e, enz. */
	int duration;
	short frs_sec;
	float frs_sec_base;
	int x, y;
	
	/* for number */
	char name[1024];
	/* for sequence */
	char first[1024];

	/* movie */
	void *movie;
	void *track;
	void *params;
	int orientation; 
	size_t framesize;
	int interlacing;
	int preseek;
	int streamindex;
	
	/* avi */
	struct _AviMovie *avi;

#if defined(_WIN32) && !defined(FREE_WINDOWS)
	/* windows avi */
	int avistreams;
	int firstvideo;
	int pfileopen;
	PAVIFILE pfile;
	PAVISTREAM pavi[MAXNUMSTREAMS];     // the current streams
	PGETFRAME pgf;
#endif

#ifdef WITH_QUICKTIME
	/* quicktime */
	struct _QuicktimeMovie *qtime;
#endif /* WITH_QUICKTIME */

#ifdef WITH_FFMPEG
	AVFormatContext *pFormatCtx;
	AVCodecContext *pCodecCtx;
	AVCodec *pCodec;
	AVFrame *pFrame;
	int pFrameComplete;
	AVFrame *pFrameRGB;
	AVFrame *pFrameDeinterlaced;
	struct SwsContext *img_convert_ctx;
	int videoStream;

	struct ImBuf *last_frame;
	int64_t last_pts;
	int64_t next_pts;
	AVPacket next_packet;
#endif

#ifdef WITH_REDCODE
	struct redcode_handle *redcodeCtx;
#endif

	char index_dir[768];

	int proxies_tried;
	int indices_tried;
	
	struct anim *proxy_anim[IMB_PROXY_MAX_SLOT];
	struct anim_index *curr_idx[IMB_TC_MAX_SLOT];

	char colorspace[64];
	char suffix[64]; /* MAX_NAME - multiview */
};

#endif