21 #include <pulse/simple.h>
22 #include <pulse/error.h>
23 #include "libavformat/avformat.h"
25 #include "libavutil/opt.h"
26 #include "libavutil/time.h"
27 #include "libavutil/log.h"
46 pa_buffer_attr attr = { -1, -1, -1, -1, -1 };
59 stream_name =
"Playback";
89 pa_simple_flush(s->
pa, NULL);
90 pa_simple_free(s->
pa);
101 if (pa_simple_flush(s->
pa, &error) < 0) {
121 if (pa_simple_write(s->
pa, pkt->
data, pkt->
size, &error) < 0) {
132 pa_usec_t latency = pa_simple_get_latency(s->
pa, NULL);
137 #define OFFSET(a) offsetof(PulseData, a)
138 #define E AV_OPT_FLAG_ENCODING_PARAM
#define LIBAVUTIL_VERSION_INT
AVCodecContext * codec
Codec context associated with this stream.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
const char * av_default_item_name(void *ctx)
Return the context name.
enum AVSampleFormat sample_fmt
audio sample format
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt)
static const AVClass pulse_muxer_class
static av_cold int pulse_write_trailer(AVFormatContext *h)
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
const OptionDef options[]
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const
Rescale a 64-bit integer by 2 rational numbers.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * priv_data
Format private data.
char filename[1024]
input or output filename
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
unsigned int nb_streams
A list of all streams in the file.
int64_t av_gettime(void)
Get the current time in microseconds.
AVOutputFormat ff_pulse_muxer
pa_sample_format_t av_cold codec_id_to_pulse_format(int codec_id)
enum AVMediaType codec_type
int sample_rate
samples per second
main external API structure.
Describe the class of an AVClass context structure.
rational number numerator/denominator
static av_cold int pulse_write_header(AVFormatContext *h)
int channels
number of audio channels
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed...
static void pulse_get_output_timestamp(AVFormatContext *h, int stream, int64_t *dts, int64_t *wall)
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
This structure stores compressed data.
#define AV_NOPTS_VALUE
Undefined timestamp value.