From c858515785e2406bfc07da587ffc3bb353b7504c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 26 Sep 2015 14:50:42 -0300 Subject: Fixed theora playback. Removed theoraplayer. Still need to get proper audio output latency in some platforms. --- scene/resources/video_stream.h | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'scene/resources/video_stream.h') diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 2ad7457ec4..3664275c78 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,33 @@ 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 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 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 Ref instance_playback()=0; + + VideoStream() {} +}; + + #endif -- cgit v1.2.3 From 52e756752e1db9e4cf7c5bb7e92d44995ad674c4 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 13 Oct 2015 01:17:54 -0300 Subject: ability to change audio track in theora video --- scene/resources/video_stream.h | 1 + 1 file changed, 1 insertion(+) (limited to 'scene/resources/video_stream.h') diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index 3664275c78..a23ef0c64f 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -82,6 +82,7 @@ class VideoStream : public Resource { public: + virtual void set_audio_track(int p_track)=0; virtual Ref instance_playback()=0; VideoStream() {} -- cgit v1.2.3