TokTok / c-toxcore

The future of online communications.
https://tox.chat
GNU General Public License v3.0
2.24k stars 283 forks source link

Feature request: send/receive opus/vpx encoded A/V frames from toxav instead of decoded frames #919

Open envsh opened 6 years ago

envsh commented 6 years ago

I am working on tox-homeserver, need forward all messages, AV streams. Now toxcore default decode/encode stream already, API only get raw stream, like PCM or YUV. If forward PCM or YUV is not boundwidth efficient, waste CPU and bandwidth.I want get network stream of OPUS or vp8 and forward this. So is some optional switch can do that?

sudden6 commented 6 years ago

No, there's no such thing. You would have to patch toxcore to do this.

envsh commented 6 years ago

can toxcore add an option for this?

iphydf commented 6 years ago

We can do that. It's low priority for us at the moment, but PRs are welcome. This can be done without breaking APIs, but it'll need a bit of thought on how to design the new API. If you have a proposal for the API, please send that for review.

zoff99 commented 2 years ago

@envsh there is support for that in the experimental fork of toxcore at:

https://github.com/zoff99/c-toxcore/blob/ac915862974b93aa4cff203fe417a0cb69af23ab/toxav/toxav.h#L739

bool toxav_video_send_frame_h264(ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *buf,
                                 uint32_t data_len, TOXAV_ERR_SEND_FRAME *error);

https://github.com/zoff99/c-toxcore/blob/ac915862974b93aa4cff203fe417a0cb69af23ab/toxav/toxav.h#L853

void toxav_callback_video_receive_frame_h264(ToxAV *av, toxav_video_receive_frame_h264_cb *callback, void *user_data);
zoff99 commented 8 months ago

also when this is merged #1431 you will be able to do this