From d8dd16e8659a36279feeb410f602d383ec285192 Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Fri, 5 Aug 2016 18:34:38 +0300 Subject: [PATCH] init commit --- toxygen/avwidgets.py | 5 ++++- toxygen/callbacks.py | 8 ++++++++ toxygen/calls.py | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/toxygen/avwidgets.py b/toxygen/avwidgets.py index 480fa28..4ae329d 100644 --- a/toxygen/avwidgets.py +++ b/toxygen/avwidgets.py @@ -10,6 +10,9 @@ import wave import settings from util import curr_directory +# TODO: widget for video +# TODO: improve IncomingCallWidget + class IncomingCallWidget(widgets.CenteredWidget): @@ -56,7 +59,7 @@ class IncomingCallWidget(widgets.CenteredWidget): self.call_type.setText(text) pr = profile.Profile.get_instance() self.accept_audio.clicked.connect(lambda: pr.accept_call(friend_number, True, False) or self.stop()) - # self.accept_video.clicked.connect(lambda: pr.start_call(friend_number, True, True)) + self.accept_video.clicked.connect(lambda: pr.accept_call(friend_number, True, True)) self.decline.clicked.connect(lambda: pr.stop_call(friend_number, False) or self.stop()) class SoundPlay(QtCore.QThread): diff --git a/toxygen/callbacks.py b/toxygen/callbacks.py index f8ddb17..e280c06 100644 --- a/toxygen/callbacks.py +++ b/toxygen/callbacks.py @@ -320,6 +320,13 @@ def callback_audio(toxav, friend_number, samples, audio_samples_per_channel, aud audio_channels_count, rate) +# ----------------------------------------------------------------------------------------------------------------- +# Callbacks - video +# ----------------------------------------------------------------------------------------------------------------- + + +def video_receive_frame(toxav, friend_number, width, height, y, u, v, ystride, ustride, vstride, user_data): + pass # ----------------------------------------------------------------------------------------------------------------- # Callbacks - initialization @@ -353,6 +360,7 @@ def init_callbacks(tox, window, tray): toxav.callback_call_state(call_state, 0) toxav.callback_call(call, 0) toxav.callback_audio_receive_frame(callback_audio, 0) + tox.callback_video_receive_frame(video_receive_frame, 0) tox.callback_friend_lossless_packet(lossless_packet, 0) tox.callback_friend_lossy_packet(lossy_packet, 0) diff --git a/toxygen/calls.py b/toxygen/calls.py index 16cef47..2f02b83 100644 --- a/toxygen/calls.py +++ b/toxygen/calls.py @@ -11,6 +11,7 @@ CALL_TYPE = { 'AUDIO': 1, 'VIDEO': 2 } +# TODO: rewrite (make class) class AV: