cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

audio-fntypes.h (2581B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef GUAC_AUDIO_FNTYPES_H
     21#define GUAC_AUDIO_FNTYPES_H
     22
     23/**
     24 * Function type definitions related to simple streaming audio.
     25 *
     26 * @file audio-fntypes.h
     27 */
     28
     29#include "audio-types.h"
     30#include "user-types.h"
     31
     32/**
     33 * Handler which is called when the audio stream is opened.
     34 *
     35 * @param audio
     36 *     The audio stream being opened.
     37 */
     38typedef void guac_audio_encoder_begin_handler(guac_audio_stream* audio);
     39
     40/**
     41 * Handler which is called when the audio stream needs to be flushed.
     42 *
     43 * @param audio
     44 *     The audio stream being flushed.
     45 */
     46typedef void guac_audio_encoder_flush_handler(guac_audio_stream* audio);
     47
     48/**
     49 * Handler which is called when the audio stream is closed.
     50 *
     51 * @param audio
     52 *     The audio stream being closed.
     53 */
     54typedef void guac_audio_encoder_end_handler(guac_audio_stream* audio);
     55
     56/**
     57 * Handler which is called when a new user has joined the Guacamole
     58 * connection associated with the audio stream.
     59 *
     60 * @param audio
     61 *     The audio stream associated with the Guacamole connection being
     62 *     joined.
     63 *
     64 * @param user
     65 *     The user that joined the connection.
     66 */
     67typedef void guac_audio_encoder_join_handler(guac_audio_stream* audio,
     68        guac_user* user);
     69
     70/**
     71 * Handler which is called when PCM data is written to the audio stream. The
     72 * format of the PCM data is dictated by the properties of the audio stream.
     73 *
     74 * @param audio
     75 *     The audio stream to which data is being written.
     76 *
     77 * @param pcm_data
     78 *     A buffer containing the raw PCM data to be written.
     79 *
     80 * @param length
     81 *     The number of bytes within the buffer that should be written to the
     82 *     audio stream.
     83 */
     84typedef void guac_audio_encoder_write_handler(guac_audio_stream* audio,
     85        const unsigned char* pcm_data, int length);
     86
     87#endif
     88