Refactor VideoPlayer and VideoStream

VideoStream:
- Fix const correctenss

VideoPlayer:
- Remove unused member variable last_frame
- Move _mix_audios function definition to source file
- Fix function parameter naming to match p_ convention
- Fix const correctness
- Add null checking
This commit is contained in:
SeleckyErik 2019-10-24 01:35:47 +01:00
parent 35944aebde
commit 61bda112bd
9 changed files with 28 additions and 16 deletions

View file

@ -279,7 +279,7 @@ void VideoStreamPlaybackGDNative::set_paused(bool p_paused) {
paused = p_paused;
}
Ref<Texture> VideoStreamPlaybackGDNative::get_texture() {
Ref<Texture> VideoStreamPlaybackGDNative::get_texture() const {
return texture;
}

View file

@ -168,7 +168,7 @@ public:
//virtual int mix(int16_t* p_buffer,int p_frames)=0;
virtual Ref<Texture> get_texture();
virtual Ref<Texture> get_texture() const;
virtual void update(float p_delta);
virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata);

View file

@ -368,7 +368,7 @@ float VideoStreamPlaybackTheora::get_time() const {
return time - AudioServer::get_singleton()->get_output_latency() - delay_compensation; //-((get_total())/(float)vi.rate);
};
Ref<Texture> VideoStreamPlaybackTheora::get_texture() {
Ref<Texture> VideoStreamPlaybackTheora::get_texture() const {
return texture;
}

View file

@ -147,7 +147,7 @@ public:
void set_file(const String &p_file);
virtual Ref<Texture> get_texture();
virtual Ref<Texture> get_texture() const;
virtual void update(float p_delta);
virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata);

View file

@ -230,7 +230,7 @@ void VideoStreamPlaybackWebm::set_audio_track(int p_idx) {
audio_track = p_idx;
}
Ref<Texture> VideoStreamPlaybackWebm::get_texture() {
Ref<Texture> VideoStreamPlaybackWebm::get_texture() const {
return texture;
}

View file

@ -90,7 +90,7 @@ public:
virtual void set_audio_track(int p_idx);
virtual Ref<Texture> get_texture();
virtual Ref<Texture> get_texture() const;
virtual void update(float p_delta);
virtual void set_mix_callback(AudioMixCallback p_callback, void *p_userdata);