65 mlt_properties props = MLT_PRODUCER_PROPERTIES(producer);
68 double SPEED = mlt_properties_get_double(props,
"speed");
74 audio->frequency = (double) audio->frequency * fabs(SPEED);
81 mlt_audio_reverse(audio);
87 mlt_audio_format *format,
92 mlt_producer producer =
static_cast<mlt_producer
>(mlt_frame_pop_audio(frame));
95 struct mlt_audio_s audio;
109 mlt_audio_set_values(&audio, *buffer, *frequency, *format, *samples, *channels);
111 int error = mlt_frame_get_audio(frame,
119 mlt_audio_get_values(&audio, buffer, frequency, format, samples, channels);
126 mlt_audio_format *format,
131 mlt_producer producer =
static_cast<mlt_producer
>(mlt_frame_pop_audio(frame));
136 double fps = mlt_producer_get_fps(producer);
138 if (mlt_properties_get(MLT_FRAME_PROPERTIES(frame),
"producer_consumer_fps"))
139 fps = mlt_properties_get_double(MLT_FRAME_PROPERTIES(frame),
"producer_consumer_fps");
141 mlt_position position = mlt_properties_get_position(MLT_FRAME_PROPERTIES(frame),
"_position");
144 *channels = *channels <= 0 ? 2 : *channels;
146 *samples = mlt_audio_calculate_frame_samples(fps, *frequency, position);
147 *format = *format == mlt_audio_none ? mlt_audio_s16 : *format;
149 size = mlt_audio_format_size(*format, *samples, *channels);
151 *buffer = mlt_pool_alloc(size);
162 mlt_frame_set_audio(frame, *buffer, *format, size, mlt_pool_release);
165 struct mlt_audio_s audio;
166 mlt_audio_set_values(&audio, *buffer, *frequency, *format, *samples, *channels);
167 mlt_audio_silence(&audio, *samples, 0);
171 mlt_audio_get_values(&audio, buffer, frequency, format, samples, channels);
178 mlt_properties props = MLT_PRODUCER_PROPERTIES(producer);
179 const int FRAME_START = mlt_properties_get_int(props,
"start_frame");
180 const int FRAME_END = mlt_properties_get_int(props,
"end_frame");
181 const bool IS_RANGE_LIMITED = mlt_properties_get_int(props,
"limit_enabled");
192 int retval = mlt_service_get_frame((mlt_service) pdata->
producer_internal, frame, index);
194 if (!mlt_frame_is_test_audio(*frame)) {
195 mlt_frame_push_audio(*frame, producer);
211 mlt_frame_push_audio(*frame, producer);
214 mlt_properties properties = MLT_FRAME_PROPERTIES(*frame);
215 mlt_properties_set_int(properties,
"test_audio", 0);
247 mlt_properties_set_position(MLT_PRODUCER_PROPERTIES(producer),
250 mlt_properties_set_position(MLT_PRODUCER_PROPERTIES(producer),
274 mlt_service_type type,
279 mlt_producer producer = mlt_producer_new(profile);
282 if (arg && producer && pdata) {
283 mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES(producer);
286 mlt_properties_set(producer_properties,
"resource", (
char*)arg);
287 producer->child = pdata;
293 char *resource = (
char*)arg;
300 mlt_properties internalProducerProps = MLT_PRODUCER_PROPERTIES(pdata->
producer_internal);
307 mlt_properties_set_string(internalProducerProps,
"eof",
"continue");
309 const char *serviceName = mlt_properties_get(internalProducerProps,
"mlt_service");
311 if (!strcmp(serviceName,
"avformat")) {
320 mlt_properties_set_int(internalProducerProps,
"noimagecache", 1);
328 const int numberOfStreams = mlt_properties_get_int(internalProducerProps,
"meta.media.nb_streams");
330 for (
int i = 0; i < numberOfStreams; i++) {
331 snprintf(key,
sizeof(key),
"meta.media.%u.stream.type", i);
333 const char* type = mlt_properties_get(internalProducerProps, key);
334 if (type && !strcmp(type,
"audio")) {
335 snprintf(key,
sizeof(key),
"meta.media.%u.codec.sample_rate", i);
339 }
else if (!strcmp(serviceName,
"count")) {
347 mlt_properties_set_string(producer_properties,
"eof",
"continue");
353 if (INVALID_CONTEXT) {
360 producer->child = NULL;
361 producer->close = NULL;
362 mlt_producer_close(producer);
static int producer_get_audio(mlt_frame frame, void **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples)