Skip to content

Commit

Permalink
updated to latest api
Browse files Browse the repository at this point in the history
  • Loading branch information
naxuroqa committed Aug 2, 2014
1 parent 87f3a01 commit cbe0d75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions src/core/AudioManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,21 @@ namespace Venom {
}
}

private static void audio_receive_callback(ToxAV.ToxAV toxav, int32 call_index, int16[] samples) {
private void audio_receive_callback(ToxAV.ToxAV toxav, int32 call_index, int16[] samples) {
//Logger.log(LogLevel.DEBUG, "Received audio samples (%d bytes)".printf(samples.length * 2));
instance.samples_in(call_index, samples);
samples_in(call_index, samples);
}

private static void video_receive_callback(ToxAV.ToxAV toxav, int32 call_index, Vpx.Image frame) {
// Logger.log(LogLevel.DEBUG, "Got video frame, of size: %d".printf(frame.img_data.length));
instance.video_buffer_in(frame);
private void video_receive_callback(ToxAV.ToxAV toxav, int32 call_index, Vpx.Image frame) {
// Logger.log(LogLevel.DEBUG, "Got video frame, of size: %d".printf(frame.img_data.length));
video_buffer_in(frame);
}

private void register_callbacks() {
toxav.register_audio_recv_callback(audio_receive_callback);
#if DEBUG
toxav.register_video_recv_callback(video_receive_callback);
#endif
}

private void destroy_audio_pipeline() {
Expand All @@ -251,10 +253,12 @@ namespace Venom {
Logger.log(LogLevel.INFO, "Audio pipeline set to playing");
}

private void set_video_pipeline_playing() {
private void set_video_pipeline_playing() {
#if DEBUG
video_pipeline_in.set_state(Gst.State.PLAYING);
video_pipeline_out.set_state(Gst.State.PLAYING);
Logger.log(LogLevel.INFO, "Video pipeline set to playing");
#endif
}

private string get_audio_caps_from_codec_settings(ref ToxAV.CodecSettings settings) {
Expand Down
4 changes: 2 additions & 2 deletions src/vapi/toxav-1.0.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace ToxAV {
* @param callback The callback
* @return void
*/
[CCode (has_target = false, has_type_id = false)]
[CCode (has_type_id = false)]
public delegate void AudioRecvCallback(ToxAV toxav, int32 call_index, [CCode(array_length_type="int")] int16[] frames);
public void register_audio_recv_callback(AudioRecvCallback callback);

Expand All @@ -249,7 +249,7 @@ namespace ToxAV {
* @param callback The callback
* @return void
*/
[CCode (has_target = false, has_type_id = false)]
[CCode (has_type_id = false)]
public delegate void VideoRecvCallback(ToxAV toxav, int32 call_index, Vpx.Image frame);
public void register_video_recv_callback(VideoRecvCallback callback);

Expand Down

0 comments on commit cbe0d75

Please sign in to comment.