本文整理汇总了C++中GST_AUDIO_INFO_CHANNELS函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_AUDIO_INFO_CHANNELS函数的具体用法?C++ GST_AUDIO_INFO_CHANNELS怎么用?C++ GST_AUDIO_INFO_CHANNELS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_AUDIO_INFO_CHANNELS函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: gst_audio_info_is_equal
/**
* gst_audio_info_is_equal:
* @info: a #GstAudioInfo
* @other: a #GstAudioInfo
*
* Compares two #GstAudioInfo and returns whether they are equal or not
*
* Returns: %TRUE if @info and @other are equal, else %FALSE.
*
* Since: 1.2
*
*/
gboolean
gst_audio_info_is_equal (const GstAudioInfo * info, const GstAudioInfo * other)
{
if (info == other)
return TRUE;
if (info->finfo == NULL || other->finfo == NULL)
return FALSE;
if (GST_AUDIO_INFO_FORMAT (info) != GST_AUDIO_INFO_FORMAT (other))
return FALSE;
if (GST_AUDIO_INFO_FLAGS (info) != GST_AUDIO_INFO_FLAGS (other))
return FALSE;
if (GST_AUDIO_INFO_LAYOUT (info) != GST_AUDIO_INFO_LAYOUT (other))
return FALSE;
if (GST_AUDIO_INFO_RATE (info) != GST_AUDIO_INFO_RATE (other))
return FALSE;
if (GST_AUDIO_INFO_CHANNELS (info) != GST_AUDIO_INFO_CHANNELS (other))
return FALSE;
if (GST_AUDIO_INFO_CHANNELS (info) > 64)
return TRUE;
if (memcmp (info->position, other->position,
GST_AUDIO_INFO_CHANNELS (info) * sizeof (GstAudioChannelPosition)) !=
0)
return FALSE;
return TRUE;
}
开发者ID:reynaldo-samsung,项目名称:gst-plugins-base,代码行数:38,代码来源:audio-info.c
示例2: gst_pulse_fill_format_info
gboolean
gst_pulse_fill_format_info (GstAudioRingBufferSpec * spec, pa_format_info ** f,
guint * channels)
{
pa_format_info *format;
pa_sample_format_t sf = PA_SAMPLE_INVALID;
GstAudioInfo *ainfo = &spec->info;
format = pa_format_info_new ();
if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW
&& GST_AUDIO_INFO_WIDTH (ainfo) == 8) {
format->encoding = PA_ENCODING_PCM;
sf = PA_SAMPLE_ULAW;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW
&& GST_AUDIO_INFO_WIDTH (ainfo) == 8) {
format->encoding = PA_ENCODING_PCM;
sf = PA_SAMPLE_ALAW;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW) {
format->encoding = PA_ENCODING_PCM;
if (!gstaudioformat_to_pasampleformat (GST_AUDIO_INFO_FORMAT (ainfo), &sf))
goto fail;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_AC3) {
format->encoding = PA_ENCODING_AC3_IEC61937;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_EAC3) {
format->encoding = PA_ENCODING_EAC3_IEC61937;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_DTS) {
format->encoding = PA_ENCODING_DTS_IEC61937;
} else if (spec->type == GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MPEG) {
format->encoding = PA_ENCODING_MPEG_IEC61937;
} else {
goto fail;
}
if (format->encoding == PA_ENCODING_PCM) {
pa_format_info_set_sample_format (format, sf);
pa_format_info_set_channels (format, GST_AUDIO_INFO_CHANNELS (ainfo));
}
pa_format_info_set_rate (format, GST_AUDIO_INFO_RATE (ainfo));
if (!pa_format_info_valid (format))
goto fail;
*f = format;
*channels = GST_AUDIO_INFO_CHANNELS (ainfo);
return TRUE;
fail:
if (format)
pa_format_info_free (format);
return FALSE;
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:54,代码来源:pulseutil.c
示例3: gst_openal_src_prepare
static gboolean
gst_openal_src_prepare (GstAudioSrc * audiosrc, GstAudioRingBufferSpec * spec)
{
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (audiosrc);
gst_openal_src_parse_spec (openalsrc, spec);
if (openalsrc->format == AL_NONE) {
GST_ELEMENT_ERROR (openalsrc, RESOURCE, SETTINGS, (NULL),
("Unable to get type %d, format %d, and %d channels", spec->type,
GST_AUDIO_INFO_FORMAT (&spec->info),
GST_AUDIO_INFO_CHANNELS (&spec->info)));
return FALSE;
}
openalsrc->device =
alcCaptureOpenDevice (openalsrc->default_device, openalsrc->rate,
openalsrc->format, openalsrc->buffer_length);
if (!openalsrc->device) {
GST_ELEMENT_ERROR (openalsrc, RESOURCE, OPEN_READ,
("Could not open device."), GST_ALC_ERROR (openalsrc->device));
return FALSE;
}
openalsrc->default_device_name =
g_strdup (alcGetString (openalsrc->device, ALC_DEVICE_SPECIFIER));
alcCaptureStart (openalsrc->device);
return TRUE;
}
开发者ID:asrashley,项目名称:gst-plugins-bad,代码行数:31,代码来源:gstopenalsrc.c
示例4: gst_level_set_caps
static gboolean
gst_level_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
{
GstLevel *filter = GST_LEVEL (trans);
GstAudioInfo info;
gint i, channels;
if (!gst_audio_info_from_caps (&info, in))
return FALSE;
switch (GST_AUDIO_INFO_FORMAT (&info)) {
case GST_AUDIO_FORMAT_S8:
filter->process = gst_level_calculate_gint8;
break;
case GST_AUDIO_FORMAT_S16:
filter->process = gst_level_calculate_gint16;
break;
case GST_AUDIO_FORMAT_S32:
filter->process = gst_level_calculate_gint32;
break;
case GST_AUDIO_FORMAT_F32:
filter->process = gst_level_calculate_gfloat;
break;
case GST_AUDIO_FORMAT_F64:
filter->process = gst_level_calculate_gdouble;
break;
default:
filter->process = NULL;
break;
}
filter->info = info;
channels = GST_AUDIO_INFO_CHANNELS (&info);
/* allocate channel variable arrays */
g_free (filter->CS);
g_free (filter->peak);
g_free (filter->last_peak);
g_free (filter->decay_peak);
g_free (filter->decay_peak_base);
g_free (filter->decay_peak_age);
filter->CS = g_new (gdouble, channels);
filter->peak = g_new (gdouble, channels);
filter->last_peak = g_new (gdouble, channels);
filter->decay_peak = g_new (gdouble, channels);
filter->decay_peak_base = g_new (gdouble, channels);
filter->decay_peak_age = g_new (GstClockTime, channels);
for (i = 0; i < channels; ++i) {
filter->CS[i] = filter->peak[i] = filter->last_peak[i] =
filter->decay_peak[i] = filter->decay_peak_base[i] = 0.0;
filter->decay_peak_age[i] = G_GUINT64_CONSTANT (0);
}
gst_level_recalc_interval_frames (filter);
return TRUE;
}
开发者ID:nnikos123,项目名称:gst-plugins-good,代码行数:60,代码来源:gstlevel.c
示例5: render_lines
static void
render_lines (GstAudioVisualizer * base, guint32 * vdata, gint16 * adata,
guint num_samples)
{
gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo);
guint i, c, s, x, y, oy;
gfloat dx, dy;
guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo);
guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo);
gint x2, y2;
/* draw lines */
dx = (gfloat) (w - 1) / (gfloat) num_samples;
dy = (h - 1) / 65536.0;
oy = (h - 1) / 2;
for (c = 0; c < channels; c++) {
s = c;
x2 = 0;
y2 = (guint) (oy + (gfloat) adata[s] * dy);
for (i = 1; i < num_samples; i++) {
x = (guint) ((gfloat) i * dx);
y = (guint) (oy + (gfloat) adata[s] * dy);
s += channels;
draw_line_aa (vdata, x2, x, y2, y, w, 0x00FFFFFF);
x2 = x;
y2 = y;
}
}
}
开发者ID:ego5710,项目名称:gst-plugins-bad,代码行数:29,代码来源:gstwavescope.c
示例6: gst_opus_enc_set_format
static gboolean
gst_opus_enc_set_format (GstAudioEncoder * benc, GstAudioInfo * info)
{
GstOpusEnc *enc;
enc = GST_OPUS_ENC (benc);
g_mutex_lock (enc->property_lock);
enc->n_channels = GST_AUDIO_INFO_CHANNELS (info);
enc->sample_rate = GST_AUDIO_INFO_RATE (info);
gst_opus_enc_setup_channel_mappings (enc, info);
GST_DEBUG_OBJECT (benc, "Setup with %d channels, %d Hz", enc->n_channels,
enc->sample_rate);
/* handle reconfigure */
if (enc->state) {
opus_multistream_encoder_destroy (enc->state);
enc->state = NULL;
}
if (!gst_opus_enc_setup (enc))
return FALSE;
enc->frame_samples = gst_opus_enc_get_frame_samples (enc);
/* feedback to base class */
gst_opus_enc_setup_base_class (enc, benc);
g_mutex_unlock (enc->property_lock);
return TRUE;
}
开发者ID:kanongil,项目名称:gst-plugins-bad,代码行数:32,代码来源:gstopusenc.c
示例7: gst_audio_filter_template_setup
static gboolean
gst_audio_filter_template_setup (GstAudioFilter * filter,
const GstAudioInfo * info)
{
GstAudioFilterTemplate *filter_template;
GstAudioFormat fmt;
gint chans, rate;
filter_template = GST_AUDIO_FILTER_TEMPLATE (filter);
rate = GST_AUDIO_INFO_RATE (info);
chans = GST_AUDIO_INFO_CHANNELS (info);
fmt = GST_AUDIO_INFO_FORMAT (info);
GST_INFO_OBJECT (filter_template, "format %d (%s), rate %d, %d channels",
fmt, GST_AUDIO_INFO_NAME (info), rate, chans);
/* if any setup needs to be done (like memory allocated), do it here */
/* The audio filter base class also saves the audio info in
* GST_AUDIO_FILTER_INFO(filter) so it's automatically available
* later from there as well */
return TRUE;
}
开发者ID:johlim,项目名称:study,代码行数:25,代码来源:gstaudiofilter.c
示例8: gst_audio_panorama_set_caps
static gboolean
gst_audio_panorama_set_caps (GstBaseTransform * base, GstCaps * incaps,
GstCaps * outcaps)
{
GstAudioPanorama *filter = GST_AUDIO_PANORAMA (base);
GstAudioInfo info;
/*GST_INFO ("incaps are %" GST_PTR_FORMAT, incaps); */
if (!gst_audio_info_from_caps (&info, incaps))
goto no_format;
GST_DEBUG ("try to process %d input with %d channels",
GST_AUDIO_INFO_FORMAT (&info), GST_AUDIO_INFO_CHANNELS (&info));
if (!gst_audio_panorama_set_process_function (filter, &info))
goto no_format;
filter->info = info;
return TRUE;
no_format:
{
GST_DEBUG ("invalid caps");
return FALSE;
}
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:27,代码来源:audiopanorama.c
示例9: gst_freeverb_set_caps
static gboolean
gst_freeverb_set_caps (GstBaseTransform * base, GstCaps * incaps,
GstCaps * outcaps)
{
GstFreeverb *filter = GST_FREEVERB (base);
GstAudioInfo info;
/*GST_INFO ("incaps are %" GST_PTR_FORMAT, incaps); */
if (!gst_audio_info_from_caps (&info, incaps))
goto no_format;
GST_DEBUG ("try to process %d input with %d channels",
GST_AUDIO_INFO_FORMAT (&info), GST_AUDIO_INFO_CHANNELS (&info));
if (!gst_freeverb_set_process_function (filter, &info))
goto no_format;
filter->info = info;
gst_freeverb_init_rev_model (filter);
filter->drained = FALSE;
GST_INFO_OBJECT (base, "model configured");
return TRUE;
no_format:
{
GST_DEBUG ("invalid caps");
return FALSE;
}
}
开发者ID:GrokImageCompression,项目名称:gst-plugins-bad,代码行数:31,代码来源:gstfreeverb.c
示例10: gst_audio_fx_base_fir_filter_setup
/* get notified of caps and plug in the correct process function */
static gboolean
gst_audio_fx_base_fir_filter_setup (GstAudioFilter * base,
const GstAudioInfo * info)
{
GstAudioFXBaseFIRFilter *self = GST_AUDIO_FX_BASE_FIR_FILTER (base);
g_mutex_lock (&self->lock);
if (self->buffer) {
gst_audio_fx_base_fir_filter_push_residue (self);
g_free (self->buffer);
self->buffer = NULL;
self->buffer_fill = 0;
self->buffer_length = 0;
self->start_ts = GST_CLOCK_TIME_NONE;
self->start_off = GST_BUFFER_OFFSET_NONE;
self->nsamples_out = 0;
self->nsamples_in = 0;
}
gst_audio_fx_base_fir_filter_select_process_function (self,
GST_AUDIO_INFO_FORMAT (info), GST_AUDIO_INFO_CHANNELS (info));
g_mutex_unlock (&self->lock);
return (self->process != NULL);
}
开发者ID:felipemogollon,项目名称:gst-plugins-good,代码行数:26,代码来源:audiofxbasefirfilter.c
示例11: render_color_lines
static void
render_color_lines (GstAudioVisualizer * base, guint32 * vdata,
gint16 * adata, guint num_samples)
{
GstWaveScope *scope = (GstWaveScope *) base;
gint channels = GST_AUDIO_INFO_CHANNELS (&base->ainfo);
guint i, c, s, x, y, oy;
gfloat dx, dy;
guint w = GST_VIDEO_INFO_WIDTH (&base->vinfo);
guint h = GST_VIDEO_INFO_HEIGHT (&base->vinfo), h1 = h - 2;
gdouble *flt = scope->flt;
gint x2, y2, y3, y4;
/* draw lines */
dx = (gfloat) (w - 1) / (gfloat) num_samples;
dy = (h - 1) / 65536.0;
oy = (h - 1) / 2;
for (c = 0; c < channels; c++) {
s = c;
/* do first pixels */
x2 = 0;
filter ((gfloat) adata[s]);
y = (guint) (oy + flt[0] * dy);
y2 = MIN (y, h1);
y = (guint) (oy + flt[3] * dy);
y3 = MIN (y, h1);
y = (guint) (oy + (flt[4] + flt[5]) * dy);
y4 = MIN (y, h1);
for (i = 1; i < num_samples; i++) {
x = (guint) ((gfloat) i * dx);
filter ((gfloat) adata[s]);
y = (guint) (oy + flt[0] * dy);
y = MIN (y, h1);
draw_line_aa (vdata, x2, x, y2, y, w, 0x00FF0000);
y2 = y;
y = (guint) (oy + flt[3] * dy);
y = MIN (y, h1);
draw_line_aa (vdata, x2, x, y3, y, w, 0x0000FF00);
y3 = y;
y = (guint) (oy + (flt[4] + flt[5]) * dy);
y = MIN (y, h1);
draw_line_aa (vdata, x2, x, y4, y, w, 0x000000FF);
y4 = y;
x2 = x;
s += channels;
}
flt += 6;
}
}
开发者ID:ego5710,项目名称:gst-plugins-bad,代码行数:58,代码来源:gstwavescope.c
示例12: gst_wave_scope_setup
static gboolean
gst_wave_scope_setup (GstAudioVisualizer * bscope)
{
GstWaveScope *scope = GST_WAVE_SCOPE (bscope);
if (scope->flt)
g_free (scope->flt);
scope->flt = g_new0 (gdouble, 6 * GST_AUDIO_INFO_CHANNELS (&bscope->ainfo));
return TRUE;
}
开发者ID:ego5710,项目名称:gst-plugins-bad,代码行数:12,代码来源:gstwavescope.c
示例13: gst_audio_fx_base_iir_filter_setup
static gboolean
gst_audio_fx_base_iir_filter_setup (GstAudioFilter * base,
const GstAudioInfo * info)
{
GstAudioFXBaseIIRFilter *filter = GST_AUDIO_FX_BASE_IIR_FILTER (base);
gboolean ret = TRUE;
gint channels;
g_mutex_lock (&filter->lock);
switch (GST_AUDIO_INFO_FORMAT (info)) {
case GST_AUDIO_FORMAT_F32:
filter->process = (GstAudioFXBaseIIRFilterProcessFunc)
process_32;
break;
case GST_AUDIO_FORMAT_F64:
filter->process = (GstAudioFXBaseIIRFilterProcessFunc)
process_64;
break;
default:
ret = FALSE;
break;
}
channels = GST_AUDIO_INFO_CHANNELS (info);
if (channels != filter->nchannels) {
guint i;
GstAudioFXBaseIIRFilterChannelCtx *ctx;
if (filter->channels) {
for (i = 0; i < filter->nchannels; i++) {
ctx = &filter->channels[i];
g_free (ctx->x);
g_free (ctx->y);
}
g_free (filter->channels);
}
filter->channels = g_new0 (GstAudioFXBaseIIRFilterChannelCtx, channels);
for (i = 0; i < channels; i++) {
ctx = &filter->channels[i];
ctx->x = g_new0 (gdouble, filter->nb);
ctx->y = g_new0 (gdouble, filter->na);
}
filter->nchannels = channels;
}
g_mutex_unlock (&filter->lock);
return ret;
}
开发者ID:BigBrother-International,项目名称:gst-plugins-good,代码行数:52,代码来源:audiofxbaseiirfilter.c
示例14: gst_celt_enc_set_format
static gboolean
gst_celt_enc_set_format (GstAudioEncoder * benc, GstAudioInfo * info)
{
GstCeltEnc *enc;
GstCaps *otherpadcaps;
enc = GST_CELT_ENC (benc);
enc->channels = GST_AUDIO_INFO_CHANNELS (info);
enc->rate = GST_AUDIO_INFO_RATE (info);
/* handle reconfigure */
if (enc->state) {
celt_encoder_destroy (enc->state);
enc->state = NULL;
}
if (enc->mode) {
celt_mode_destroy (enc->mode);
enc->mode = NULL;
}
memset (&enc->header, 0, sizeof (enc->header));
otherpadcaps = gst_pad_get_allowed_caps (GST_AUDIO_ENCODER_SRC_PAD (enc));
if (otherpadcaps) {
if (!gst_caps_is_empty (otherpadcaps)) {
GstStructure *ps = gst_caps_get_structure (otherpadcaps, 0);
gst_structure_get_int (ps, "frame-size", &enc->frame_size);
}
gst_caps_unref (otherpadcaps);
}
if (enc->requested_frame_size > 0)
enc->frame_size = enc->requested_frame_size;
GST_DEBUG_OBJECT (enc, "channels=%d rate=%d frame-size=%d",
enc->channels, enc->rate, enc->frame_size);
if (!gst_celt_enc_setup (enc))
return FALSE;
/* feedback to base class */
gst_audio_encoder_set_latency (benc,
gst_celt_enc_get_latency (enc), gst_celt_enc_get_latency (enc));
gst_audio_encoder_set_frame_samples_min (benc, enc->frame_size);
gst_audio_encoder_set_frame_samples_max (benc, enc->frame_size);
gst_audio_encoder_set_frame_max (benc, 1);
return TRUE;
}
开发者ID:dylansong77,项目名称:gstreamer,代码行数:49,代码来源:gstceltenc.c
示例15: gst_space_scope_render
static gboolean
gst_space_scope_render (GstAudioVisualizer * base, GstBuffer * audio,
GstVideoFrame * video)
{
GstSpaceScope *scope = GST_SPACE_SCOPE (base);
GstMapInfo amap;
guint num_samples;
gst_buffer_map (audio, &amap, GST_MAP_READ);
num_samples =
amap.size / (GST_AUDIO_INFO_CHANNELS (&base->ainfo) * sizeof (gint16));
scope->process (base, (guint32 *) GST_VIDEO_FRAME_PLANE_DATA (video, 0),
(gint16 *) amap.data, num_samples);
gst_buffer_unmap (audio, &amap);
return TRUE;
}
开发者ID:reynaldo-samsung,项目名称:gst-plugins-bad,代码行数:17,代码来源:gstspacescope.c
示例16: pcm_config_from_spec
static void
pcm_config_from_spec (struct pcm_config *config,
const GstAudioRingBufferSpec * spec)
{
gint64 frames;
config->format = pcm_format_from_gst (GST_AUDIO_INFO_FORMAT (&spec->info));
config->channels = GST_AUDIO_INFO_CHANNELS (&spec->info);
config->rate = GST_AUDIO_INFO_RATE (&spec->info);
gst_audio_info_convert (&spec->info,
GST_FORMAT_TIME, spec->latency_time * GST_USECOND,
GST_FORMAT_DEFAULT /* frames */ , &frames);
config->period_size = frames;
config->period_count = spec->buffer_time / spec->latency_time;
}
开发者ID:jhgorse,项目名称:gst-plugins-bad,代码行数:17,代码来源:tinyalsasink.c
示例17: gst_deinterleave_add_new_pads
static void
gst_deinterleave_add_new_pads (GstDeinterleave * self, GstCaps * caps)
{
GstPad *pad;
guint i;
for (i = 0; i < GST_AUDIO_INFO_CHANNELS (&self->audio_info); i++) {
gchar *name = g_strdup_printf ("src_%u", i);
GstCaps *srccaps;
GstAudioInfo info;
GstAudioFormat format = GST_AUDIO_INFO_FORMAT (&self->audio_info);
gint rate = GST_AUDIO_INFO_RATE (&self->audio_info);
GstAudioChannelPosition position = GST_AUDIO_CHANNEL_POSITION_MONO;
CopyStickyEventsData data;
/* Set channel position if we know it */
if (self->keep_positions)
position = GST_AUDIO_INFO_POSITION (&self->audio_info, i);
gst_audio_info_init (&info);
gst_audio_info_set_format (&info, format, rate, 1, &position);
srccaps = gst_audio_info_to_caps (&info);
pad = gst_pad_new_from_static_template (&src_template, name);
g_free (name);
gst_pad_use_fixed_caps (pad);
gst_pad_set_query_function (pad,
GST_DEBUG_FUNCPTR (gst_deinterleave_src_query));
gst_pad_set_active (pad, TRUE);
data.pad = pad;
data.caps = srccaps;
gst_pad_sticky_events_foreach (self->sink, copy_sticky_events, &data);
if (data.caps)
gst_pad_set_caps (pad, data.caps);
gst_element_add_pad (GST_ELEMENT (self), pad);
self->srcpads = g_list_prepend (self->srcpads, gst_object_ref (pad));
gst_caps_unref (srccaps);
}
gst_element_no_more_pads (GST_ELEMENT (self));
self->srcpads = g_list_reverse (self->srcpads);
}
开发者ID:PeterXu,项目名称:gst-mobile,代码行数:46,代码来源:deinterleave.c
示例18: gst_chromaprint_transform_ip
static GstFlowReturn
gst_chromaprint_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
{
GstChromaprint *chromaprint = GST_CHROMAPRINT (trans);
GstAudioFilter *filter = GST_AUDIO_FILTER (trans);
GstMapInfo map_info;
guint nsamples;
gint rate, channels;
rate = GST_AUDIO_INFO_RATE (&filter->info);
channels = GST_AUDIO_INFO_CHANNELS (&filter->info);
if (G_UNLIKELY (rate <= 0 || channels <= 0))
return GST_FLOW_NOT_NEGOTIATED;
if (!chromaprint->record)
return GST_FLOW_OK;
if (!gst_buffer_map (buf, &map_info, GST_MAP_READ))
return GST_FLOW_ERROR;
nsamples = map_info.size / (channels * 2);
if (nsamples == 0)
goto end;
if (chromaprint->nsamples == 0) {
chromaprint_start (chromaprint->context, rate, channels);
}
chromaprint->nsamples += nsamples;
chromaprint->duration = chromaprint->nsamples / rate;
chromaprint_feed (chromaprint->context, map_info.data,
map_info.size / sizeof (guint16));
if (chromaprint->duration >= chromaprint->max_duration
&& !chromaprint->fingerprint) {
gst_chromaprint_create_fingerprint (chromaprint);
}
end:
gst_buffer_unmap (buf, &map_info);
return GST_FLOW_OK;
}
开发者ID:asrashley,项目名称:gst-plugins-bad,代码行数:45,代码来源:gstchromaprint.c
示例19: gst_freeverb_set_process_function
static gboolean
gst_freeverb_set_process_function (GstFreeverb * filter, GstAudioInfo * info)
{
gint channel_index, format_index;
const GstAudioFormatInfo *finfo = info->finfo;
/* set processing function */
channel_index = GST_AUDIO_INFO_CHANNELS (info) - 1;
if (channel_index > 1 || channel_index < 0) {
filter->process = NULL;
return FALSE;
}
format_index = GST_AUDIO_FORMAT_INFO_IS_FLOAT (finfo) ? 1 : 0;
filter->process = process_functions[channel_index][format_index];
return TRUE;
}
开发者ID:GrokImageCompression,项目名称:gst-plugins-bad,代码行数:18,代码来源:gstfreeverb.c
示例20: gst_deinterleave_chain
static GstFlowReturn
gst_deinterleave_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstDeinterleave *self = GST_DEINTERLEAVE (parent);
GstFlowReturn ret;
g_return_val_if_fail (self->func != NULL, GST_FLOW_NOT_NEGOTIATED);
g_return_val_if_fail (GST_AUDIO_INFO_WIDTH (&self->audio_info) > 0,
GST_FLOW_NOT_NEGOTIATED);
g_return_val_if_fail (GST_AUDIO_INFO_CHANNELS (&self->audio_info) > 0,
GST_FLOW_NOT_NEGOTIATED);
ret = gst_deinterleave_process (self, buffer);
if (ret != GST_FLOW_OK)
GST_DEBUG_OBJECT (self, "flow return: %s", gst_flow_get_name (ret));
return ret;
}
开发者ID:PeterXu,项目名称:gst-mobile,代码行数:19,代码来源:deinterleave.c
注:本文中的GST_AUDIO_INFO_CHANNELS函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论