diff options
Diffstat (limited to 'Src/replicant/ultravox')
-rw-r--r-- | Src/replicant/ultravox/ifc_ultravox_playback.h | 26 | ||||
-rw-r--r-- | Src/replicant/ultravox/ifc_ultravox_reader.h | 28 | ||||
-rw-r--r-- | Src/replicant/ultravox/svc_ultravox_playback.h | 27 |
3 files changed, 81 insertions, 0 deletions
diff --git a/Src/replicant/ultravox/ifc_ultravox_playback.h b/Src/replicant/ultravox/ifc_ultravox_playback.h new file mode 100644 index 00000000..75f3b94c --- /dev/null +++ b/Src/replicant/ultravox/ifc_ultravox_playback.h @@ -0,0 +1,26 @@ +#pragma once +#include "jnetlib/jnetlib_defines.h" +#include "foundation/dispatch.h" +#include "foundation/error.h" +#include "player/svc_output.h" +#include "player/ifc_player.h" +#include "http/ifc_http.h" +#include "ultravox/ifc_ultravox_reader.h" +#include "player/ifc_playback_parameters.h" + +class ifc_ultravox_playback: public Wasabi2::Dispatchable +{ +protected: + ifc_ultravox_playback() : Dispatchable(DISPATCHABLE_VERSION) {} + ~ifc_ultravox_playback() {} +public: + enum + { + DISPATCHABLE_VERSION, + }; + + int Run(ifc_http *http_parent, ifc_player *player, ifc_ultravox_reader *reader) { return UltravoxPlayback_Run(http_parent, player, reader); } + +protected: + virtual int WASABICALL UltravoxPlayback_Run(ifc_http *http_parent, ifc_player *player, ifc_ultravox_reader *reader)=0; +}; diff --git a/Src/replicant/ultravox/ifc_ultravox_reader.h b/Src/replicant/ultravox/ifc_ultravox_reader.h new file mode 100644 index 00000000..745eb145 --- /dev/null +++ b/Src/replicant/ultravox/ifc_ultravox_reader.h @@ -0,0 +1,28 @@ +#pragma once +#include "foundation/dispatch.h" + +class ifc_ultravox_reader : public Wasabi2::Dispatchable +{ +protected: + ifc_ultravox_reader() : Dispatchable(DISPATCHABLE_VERSION) {} + ~ifc_ultravox_reader() {} +public: + enum + { + DISPATCHABLE_VERSION=0, + }; + + size_t BytesBuffered() { return UltravoxReader_BytesBuffered(); } + int Read(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Read(buffer, buffer_length, bytes_read); } + int Peek(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Peek(buffer, buffer_length, bytes_read); } + int IsClosed() { return UltravoxReader_IsClosed(); } + /* gives you back the contents of exactly one packet. used when Ultravox is provided codec framing */ + int ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_ReadPacket(buffer, buffer_length, bytes_read); } +private: + virtual int WASABICALL UltravoxReader_Read(void *buffer, size_t buffer_length, size_t *bytes_read)=0; + virtual int WASABICALL UltravoxReader_Peek(void *buffer, size_t buffer_length, size_t *bytes_read)=0; + virtual size_t WASABICALL UltravoxReader_BytesBuffered()=0; + virtual int WASABICALL UltravoxReader_IsClosed()=0; + virtual int WASABICALL UltravoxReader_ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read)=0; + +}; diff --git a/Src/replicant/ultravox/svc_ultravox_playback.h b/Src/replicant/ultravox/svc_ultravox_playback.h new file mode 100644 index 00000000..2190d1cc --- /dev/null +++ b/Src/replicant/ultravox/svc_ultravox_playback.h @@ -0,0 +1,27 @@ +#pragma once +#include "jnetlib/jnetlib_defines.h" +#include "foundation/dispatch.h" +#include "foundation/error.h" +#include "ultravox/ifc_ultravox_playback.h" +// {CAA4D831-8387-4F7D-A752-6DD0759E9C09} +static const GUID ultravox_playback_service_type_guid = +{ 0xcaa4d831, 0x8387, 0x4f7d, { 0xa7, 0x52, 0x6d, 0xd0, 0x75, 0x9e, 0x9c, 0x9 } }; + + +class svc_ultravox_playback : public Wasabi2::Dispatchable +{ +protected: + svc_ultravox_playback() : Dispatchable(DISPATCHABLE_VERSION) {} + ~svc_ultravox_playback() {} +public: + static GUID GetServiceType() { return ultravox_playback_service_type_guid; } + + NError CreatePlayback(jnl_http_t http, unsigned int classtype, ifc_ultravox_playback **playback) { return UltravoxPlaybackService_CreateDemuxer(http, classtype, playback); } + enum + { + DISPATCHABLE_VERSION, + }; + +protected: + virtual NError WASABICALL UltravoxPlaybackService_CreateDemuxer(jnl_http_t http, unsigned int classtype, ifc_ultravox_playback **playback) = 0; +}; |