summaryrefslogtreecommitdiff
path: root/src/libs/video/video.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/video/video.h')
-rw-r--r--src/libs/video/video.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/libs/video/video.h b/src/libs/video/video.h
new file mode 100644
index 0000000..5e76aa4
--- /dev/null
+++ b/src/libs/video/video.h
@@ -0,0 +1,56 @@
+/*
+ * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef LIBS_VIDEO_VIDEO_H_
+#define LIBS_VIDEO_VIDEO_H_
+
+#include "libs/vidlib.h"
+#include "libs/sndlib.h"
+#include "libs/graphics/tfb_draw.h"
+#include "types.h"
+#include "videodec.h"
+#include "libs/sound/sound.h"
+
+
+typedef struct tfb_videoclip
+{
+ TFB_VideoDecoder *decoder; // decoder to read from
+ float length; // total length of clip seconds
+ uint32 w, h;
+
+ // video player data
+ RECT dst_rect; // destination screen rect
+ RECT src_rect; // source rect
+ MUSIC_REF hAudio;
+ uint32 frame_time; // time when next frame should be rendered
+ TFB_Image* frame; // frame preped and optimized for rendering
+ uint32 cur_frame; // index of frame currently displayed
+ bool playing;
+ bool own_audio;
+ uint32 loop_frame; // frame index to loop from
+ uint32 loop_to; // frame index to loop to
+
+ Mutex guard;
+ uint32 want_frame; // audio-signaled desired frame index
+ int lag_cnt; // N of frames video is behind or ahead of audio
+
+ void* data; // user-defined data
+
+} TFB_VideoClip;
+
+extern VIDEO_REF _init_video_file(const char *pStr);
+
+#endif // LIBS_VIDEO_VIDEO_H_