2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2003-04-28 02:15:46 +00:00
|
|
|
* 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
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2003-04-28 02:15:46 +00:00
|
|
|
*
|
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2003-04-28 02:15:46 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup imbuf
|
2011-02-27 20:23:21 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __IMB_ANIM_H__
|
|
|
|
|
#define __IMB_ANIM_H__
|
2003-04-28 02:15:46 +00:00
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2011-09-19 06:32:19 +00:00
|
|
|
# define INC_OLE2
|
|
|
|
|
# include <windows.h>
|
|
|
|
|
# include <windowsx.h>
|
|
|
|
|
# include <mmsystem.h>
|
|
|
|
|
# include <memory.h>
|
|
|
|
|
# include <commdlg.h>
|
2017-05-27 15:34:55 -04:00
|
|
|
# include <vfw.h>
|
2003-04-28 02:15:46 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
# undef AVIIF_KEYFRAME // redefined in AVI_avi.h
|
|
|
|
|
# undef AVIIF_LIST // redefined in AVI_avi.h
|
|
|
|
|
#endif /* _WIN32 */
|
2003-04-28 02:15:46 +00:00
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdio.h>
|
2011-09-19 06:32:19 +00:00
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
# include <io.h>
|
2003-04-28 02:15:46 +00:00
|
|
|
#else
|
2011-09-19 06:32:19 +00:00
|
|
|
# include <dirent.h>
|
2003-04-28 02:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "imbuf.h"
|
|
|
|
|
|
2012-10-08 02:51:42 +00:00
|
|
|
#ifdef WITH_AVI
|
|
|
|
|
# include "AVI_avi.h"
|
|
|
|
|
#endif
|
2003-04-28 02:15:46 +00:00
|
|
|
|
|
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
|
|
#include "IMB_allocimbuf.h"
|
|
|
|
|
|
2016-02-20 11:40:25 +05:00
|
|
|
#ifdef WITH_FFMPEG
|
|
|
|
|
# include <libavformat/avformat.h>
|
|
|
|
|
# include <libavcodec/avcodec.h>
|
|
|
|
|
# include <libswscale/swscale.h>
|
|
|
|
|
#endif
|
2003-04-28 02:15:46 +00:00
|
|
|
|
|
|
|
|
/* more endianness... should move to a separate file... */
|
2011-09-19 08:02:17 +00:00
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
|
# define LITTLE_LONG SWAP_LONG
|
2003-04-28 02:15:46 +00:00
|
|
|
#else
|
2011-09-19 08:02:17 +00:00
|
|
|
# define LITTLE_LONG ENDIAN_NOP
|
2003-04-28 02:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
2011-01-15 16:14:57 +00:00
|
|
|
/* anim.curtype, runtime only */
|
2019-04-17 06:17:24 +02:00
|
|
|
#define ANIM_NONE 0
|
|
|
|
|
#define ANIM_SEQUENCE (1 << 0)
|
|
|
|
|
#define ANIM_MOVIE (1 << 4)
|
|
|
|
|
#define ANIM_AVI (1 << 6)
|
|
|
|
|
#define ANIM_FFMPEG (1 << 8)
|
2003-04-28 02:15:46 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
#define MAXNUMSTREAMS 50
|
2003-04-28 02:15:46 +00:00
|
|
|
|
2019-01-28 21:08:24 +11:00
|
|
|
struct IDProperty;
|
Merge image related changes from the render branch. This includes the image
tile cache code in imbuf, but it is not hooked up to the render engine.
Imbuf module: some small refactoring and removing a lot of unused or old code
(about 6.5k lines).
* Added a ImFileType struct with callbacks to make adding an file format type,
or making changes to the API easier.
* Move imbuf init/exit code into IMB_init()/IMB_exit() functions.
* Increased mipmap levels from 10 to 20, you run into this limit already with
a 2k image.
* Removed hamx, amiga, anim5 format support.
* Removed colormap saving, only simple colormap code now for reading tga.
* Removed gen_dynlibtiff.py, editing this is almost as much work as just
editing the code directly.
* Functions removed that were only used for sequencer plugin API:
IMB_anim_nextpic, IMB_clever_double, IMB_antialias, IMB_gamwarp,
IMB_scalefieldImBuf, IMB_scalefastfieldImBuf, IMB_onethird, IMB_halflace,
IMB_dit0, IMB_dit2, IMB_cspace
* Write metadata info into OpenEXR images. Can be viewed with the command
line utility 'exrheader'
For the image tile cache code, see this page:
http://wiki.blender.org/index.php/Dev:2.5/Source/Imaging/ImageTileCache
2010-05-07 15:18:04 +00:00
|
|
|
struct _AviMovie;
|
== Sequencer ==
This patch adds:
* support for proxy building again (missing feature from Blender 2.49)
additionally to the way, Blender 2.49 worked, you can select several
strips at once and make Blender build proxies in the background (using
the job system)
Also a new thing: movie proxies are now build into AVI files, and
the proxy system is moved into ImBuf-library, so that other parts
of blender can also benefit from it.
* Timecode support: to fix seeking issues with files, that have
a) varying frame rates
b) very large GOP lengths
c) are broken inbetween
d) use different time code tracks
the proxy builder can now also build timecode indices, which are
used (optionally) for seeking.
For the first time, it is possible, to do frame exact seeking on
all file types.
* Support for different video-streams in one video file (can be
selected in sequencer, other parts of blender can also use it,
but UI has to be added accordingly)
* IMPORTANT: this patch *requires* ffmpeg 0.7 or newer, since
older versions don't support the pkt_pts field, that is essential
for building timecode indices.
Windows and Mac libs are already updated, Linux-users have to build
their own ffmpeg verions until distros keep up.
2011-08-28 14:46:03 +00:00
|
|
|
struct anim_index;
|
Merge image related changes from the render branch. This includes the image
tile cache code in imbuf, but it is not hooked up to the render engine.
Imbuf module: some small refactoring and removing a lot of unused or old code
(about 6.5k lines).
* Added a ImFileType struct with callbacks to make adding an file format type,
or making changes to the API easier.
* Move imbuf init/exit code into IMB_init()/IMB_exit() functions.
* Increased mipmap levels from 10 to 20, you run into this limit already with
a 2k image.
* Removed hamx, amiga, anim5 format support.
* Removed colormap saving, only simple colormap code now for reading tga.
* Removed gen_dynlibtiff.py, editing this is almost as much work as just
editing the code directly.
* Functions removed that were only used for sequencer plugin API:
IMB_anim_nextpic, IMB_clever_double, IMB_antialias, IMB_gamwarp,
IMB_scalefieldImBuf, IMB_scalefastfieldImBuf, IMB_onethird, IMB_halflace,
IMB_dit0, IMB_dit2, IMB_cspace
* Write metadata info into OpenEXR images. Can be viewed with the command
line utility 'exrheader'
For the image tile cache code, see this page:
http://wiki.blender.org/index.php/Dev:2.5/Source/Imaging/ImageTileCache
2010-05-07 15:18:04 +00:00
|
|
|
|
2003-04-28 02:15:46 +00:00
|
|
|
struct anim {
|
2019-04-17 06:17:24 +02:00
|
|
|
int ib_flags;
|
|
|
|
|
int curtype;
|
|
|
|
|
int curposition; /* index 0 = 1e, 1 = 2e, enz. */
|
2019-09-19 15:26:17 +02:00
|
|
|
int duration_in_frames;
|
2019-04-17 06:17:24 +02:00
|
|
|
int frs_sec;
|
|
|
|
|
double 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;
|
2003-04-28 02:15:46 +00:00
|
|
|
|
2017-05-27 15:34:55 -04:00
|
|
|
#if defined(_WIN32)
|
2019-04-17 06:17:24 +02:00
|
|
|
/* windows avi */
|
|
|
|
|
int avistreams;
|
|
|
|
|
int firstvideo;
|
|
|
|
|
int pfileopen;
|
|
|
|
|
PAVIFILE pfile;
|
|
|
|
|
PAVISTREAM pavi[MAXNUMSTREAMS]; // the current streams
|
|
|
|
|
PGETFRAME pgf;
|
2003-04-28 02:15:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
2006-02-05 19:23:34 +00:00
|
|
|
#ifdef WITH_FFMPEG
|
2019-04-17 06:17:24 +02:00
|
|
|
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;
|
2006-02-05 19:23:34 +00:00
|
|
|
#endif
|
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
char index_dir[768];
|
== Sequencer ==
This patch adds:
* support for proxy building again (missing feature from Blender 2.49)
additionally to the way, Blender 2.49 worked, you can select several
strips at once and make Blender build proxies in the background (using
the job system)
Also a new thing: movie proxies are now build into AVI files, and
the proxy system is moved into ImBuf-library, so that other parts
of blender can also benefit from it.
* Timecode support: to fix seeking issues with files, that have
a) varying frame rates
b) very large GOP lengths
c) are broken inbetween
d) use different time code tracks
the proxy builder can now also build timecode indices, which are
used (optionally) for seeking.
For the first time, it is possible, to do frame exact seeking on
all file types.
* Support for different video-streams in one video file (can be
selected in sequencer, other parts of blender can also use it,
but UI has to be added accordingly)
* IMPORTANT: this patch *requires* ffmpeg 0.7 or newer, since
older versions don't support the pkt_pts field, that is essential
for building timecode indices.
Windows and Mac libs are already updated, Linux-users have to build
their own ffmpeg verions until distros keep up.
2011-08-28 14:46:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
int proxies_tried;
|
|
|
|
|
int indices_tried;
|
2018-06-17 17:04:54 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
struct anim *proxy_anim[IMB_PROXY_MAX_SLOT];
|
|
|
|
|
struct anim_index *curr_idx[IMB_TC_MAX_SLOT];
|
== Sequencer ==
This patch adds:
* support for proxy building again (missing feature from Blender 2.49)
additionally to the way, Blender 2.49 worked, you can select several
strips at once and make Blender build proxies in the background (using
the job system)
Also a new thing: movie proxies are now build into AVI files, and
the proxy system is moved into ImBuf-library, so that other parts
of blender can also benefit from it.
* Timecode support: to fix seeking issues with files, that have
a) varying frame rates
b) very large GOP lengths
c) are broken inbetween
d) use different time code tracks
the proxy builder can now also build timecode indices, which are
used (optionally) for seeking.
For the first time, it is possible, to do frame exact seeking on
all file types.
* Support for different video-streams in one video file (can be
selected in sequencer, other parts of blender can also use it,
but UI has to be added accordingly)
* IMPORTANT: this patch *requires* ffmpeg 0.7 or newer, since
older versions don't support the pkt_pts field, that is essential
for building timecode indices.
Windows and Mac libs are already updated, Linux-users have to build
their own ffmpeg verions until distros keep up.
2011-08-28 14:46:03 +00:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
char colorspace[64];
|
|
|
|
|
char suffix[64]; /* MAX_NAME - multiview */
|
2018-04-05 16:34:36 +02:00
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
struct IDProperty *metadata;
|
2003-04-28 02:15:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|