1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 *
9 * by Stan Seibert <volsung@xiph.org> AND OTHER CONTRIBUTORS *
10 * http://www.xiph.org/ *
12 ********************************************************************
16 ********************************************************************/
18 #ifndef __TRANSPORT_H__
19 #define __TRANSPORT_H__
21 #include <sys/types.h>
23 #include "ogg/os_types.h"
27 typedef struct data_source_stats_t
{
28 ogg_int64_t bytes_read
;
29 int input_buffer_used
; /* flag to show if this data_source uses an
30 input buffer. Ignore the contents of
31 input_buffer and transfer rate if it is
34 buffer_stats_t input_buffer
;
35 } data_source_stats_t
;
39 typedef struct data_source_t
{
41 struct transport_t
*transport
;
45 typedef struct transport_t
{
47 int (* can_transport
)(char *source_string
);
48 data_source_t
* (* open
) (char *source_string
, ogg123_options_t
*ogg123_opts
);
49 int (* peek
) (data_source_t
*source
, void *ptr
, size_t size
, size_t nmemb
);
50 int (* read
) (data_source_t
*source
, void *ptr
, size_t size
, size_t nmemb
);
51 int (* seek
) (data_source_t
*source
, long offset
, int whence
);
52 data_source_stats_t
* (* statistics
) (data_source_t
*source
);
53 long (* tell
) (data_source_t
*source
);
54 void (* close
) (data_source_t
*source
);
57 transport_t
*get_transport_by_name (char *name
);
58 transport_t
*select_transport (char *source
);
60 data_source_stats_t
*malloc_data_source_stats (data_source_stats_t
*to_copy
);
62 #endif /* __TRANSPORT_H__ */