aboutsummaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorreduz2015-10-16 19:13:09 -0300
committerreduz2015-10-16 19:13:09 -0300
commit17a90ddc0824bb51b5ea707f5d4d11aed301f91d (patch)
treef17a5e3c66e1aaee0cabe2f16d16611b97bda6cb /scene/resources
parent078a474135b47adb3cbdf414c737b77ee17fe596 (diff)
parent79e5ced7e668fa53567ac6aaf5a26393cea6c9a2 (diff)
downloadgodot-17a90ddc0824bb51b5ea707f5d4d11aed301f91d.tar.gz
godot-17a90ddc0824bb51b5ea707f5d4d11aed301f91d.tar.zst
godot-17a90ddc0824bb51b5ea707f5d4d11aed301f91d.zip
Merge branch 'master' of https://github.com/okamstudio/godot
Conflicts: scene/resources/packed_scene.h
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/video_stream.cpp8
-rw-r--r--scene/resources/video_stream.h36
2 files changed, 30 insertions, 14 deletions
diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp
index b27413bb6..c957fd4c6 100644
--- a/scene/resources/video_stream.cpp
+++ b/scene/resources/video_stream.cpp
@@ -28,16 +28,12 @@
/*************************************************************************/
#include "video_stream.h"
-void VideoStream::_bind_methods() {
+void VideoStreamPlayback::_bind_methods() {
- ObjectTypeDB::bind_method(_MD("get_pending_frame_count"),&VideoStream::get_pending_frame_count);
- ObjectTypeDB::bind_method(_MD("pop_frame"),&VideoStream::pop_frame);
- ObjectTypeDB::bind_method(_MD("peek_frame"),&VideoStream::peek_frame);
- ObjectTypeDB::bind_method(_MD("set_audio_track","idx"),&VideoStream::set_audio_track);
};
-VideoStream::VideoStream() {
+VideoStreamPlayback::VideoStreamPlayback() {
};
diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h
index 2ad7457ec..a23ef0c64 100644
--- a/scene/resources/video_stream.h
+++ b/scene/resources/video_stream.h
@@ -33,15 +33,17 @@
#include "scene/resources/texture.h"
-class VideoStream : public Resource {
+class VideoStreamPlayback : public Resource {
- OBJ_TYPE(VideoStream,Resource);
+ OBJ_TYPE(VideoStreamPlayback,Resource);
protected:
static void _bind_methods();
public:
+ typedef int (*AudioMixCallback)(void* p_udata,const int16_t *p_data,int p_frames);
+
virtual void stop()=0;
virtual void play()=0;
@@ -58,16 +60,34 @@ public:
virtual float get_pos() const=0;
virtual void seek_pos(float p_time)=0;
- virtual int get_pending_frame_count() const=0;
- virtual void pop_frame(Ref<ImageTexture> p_tex)=0;
- virtual Image peek_frame() const=0;
-
virtual void set_audio_track(int p_idx) =0;
- virtual void update(float p_time)=0;
+ //virtual int mix(int16_t* p_bufer,int p_frames)=0;
+
+ virtual Ref<Texture> get_texture()=0;
+ virtual void update(float p_delta)=0;
- VideoStream();
+ virtual void set_mix_callback(AudioMixCallback p_callback,void *p_userdata)=0;
+ virtual int get_channels() const=0;
+ virtual int get_mix_rate() const=0;
+
+ VideoStreamPlayback();
};
+
+class VideoStream : public Resource {
+
+ OBJ_TYPE( VideoStream, Resource );
+ OBJ_SAVE_TYPE( VideoStream ); //children are all saved as AudioStream, so they can be exchanged
+
+public:
+
+ virtual void set_audio_track(int p_track)=0;
+ virtual Ref<VideoStreamPlayback> instance_playback()=0;
+
+ VideoStream() {}
+};
+
+
#endif