• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GST_AUDIO_DECODER函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GST_AUDIO_DECODER函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_AUDIO_DECODER函数的具体用法?C++ GST_AUDIO_DECODER怎么用?C++ GST_AUDIO_DECODER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GST_AUDIO_DECODER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gst_amc_audio_dec_init

static void
gst_amc_audio_dec_init (GstAmcAudioDec * self)
{
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (self), TRUE);
  gst_audio_decoder_set_drainable (GST_AUDIO_DECODER (self), TRUE);

  g_mutex_init (&self->drain_lock);
  g_cond_init (&self->drain_cond);
}
开发者ID:iainlane,项目名称:gstreamer,代码行数:9,代码来源:gstamcaudiodechybris.c


示例2: gst_ffmpegauddec_init

static void
gst_ffmpegauddec_init (GstFFMpegAudDec * ffmpegdec)
{
  GstFFMpegAudDecClass *klass =
      (GstFFMpegAudDecClass *) G_OBJECT_GET_CLASS (ffmpegdec);

  /* some ffmpeg data */
  ffmpegdec->context = avcodec_alloc_context3 (klass->in_plugin);
  ffmpegdec->opened = FALSE;

  gst_audio_decoder_set_drainable (GST_AUDIO_DECODER (ffmpegdec), TRUE);
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (ffmpegdec), TRUE);
}
开发者ID:cablelabs,项目名称:gst-libav,代码行数:13,代码来源:gstavauddec.c


示例3: gst_ffmpegauddec_drain

static void
gst_ffmpegauddec_drain (GstFFMpegAudDec * ffmpegdec)
{
  GstFFMpegAudDecClass *oclass;

  oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));

  if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
    gint have_data, len;

    GST_LOG_OBJECT (ffmpegdec,
        "codec has delay capabilities, calling until libav has drained everything");

    do {
      GstFlowReturn ret;

      len = gst_ffmpegauddec_frame (ffmpegdec, NULL, 0, &have_data, &ret);

    } while (len >= 0 && have_data == 1);
    avcodec_flush_buffers (ffmpegdec->context);
  }

  if (ffmpegdec->outbuf)
    gst_audio_decoder_finish_frame (GST_AUDIO_DECODER (ffmpegdec),
        ffmpegdec->outbuf, 1);
  ffmpegdec->outbuf = NULL;
}
开发者ID:GStreamer,项目名称:gst-libav,代码行数:27,代码来源:gstavauddec.c


示例4: gst_dtsdec_renegotiate

static gboolean
gst_dtsdec_renegotiate (GstDtsDec * dts)
{
  gint channels;
  gboolean result = FALSE;
  GstAudioChannelPosition from[6], to[6];
  GstAudioInfo info;

  channels = gst_dtsdec_channels (dts->using_channels, from);

  if (!channels)
    goto done;

  GST_INFO_OBJECT (dts, "dtsdec renegotiate, channels=%d, rate=%d",
      channels, dts->sample_rate);

  memcpy (to, from, sizeof (GstAudioChannelPosition) * channels);
  gst_audio_channel_positions_to_valid_order (to, channels);
  gst_audio_get_channel_reorder_map (channels, from, to,
      dts->channel_reorder_map);


  gst_audio_info_init (&info);
  gst_audio_info_set_format (&info,
      SAMPLE_TYPE, dts->sample_rate, channels, (channels > 1 ? to : NULL));

  if (!gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (dts), &info))
    goto done;

  result = TRUE;

done:
  return result;
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:34,代码来源:gstdtsdec.c


示例5: gst_mulawdec_init

static void
gst_mulawdec_init (GstMuLawDec * mulawdec)
{
    gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (mulawdec), TRUE);
    gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
            (mulawdec), TRUE);
    GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (mulawdec));
}
开发者ID:DylanZA,项目名称:gst-plugins-good,代码行数:8,代码来源:mulaw-decode.c


示例6: gst_droidadec_init

static void
gst_droidadec_init (GstDroidADec * dec)
{
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
  gst_audio_decoder_set_drainable (GST_AUDIO_DECODER (dec), TRUE);

  dec->codec = NULL;
  dec->codec_type = NULL;
  dec->downstream_flow_ret = GST_FLOW_OK;
  dec->eos = FALSE;
  dec->codec_data = NULL;
  dec->channels = 0;
  dec->rate = 0;

  g_mutex_init (&dec->eos_lock);
  g_cond_init (&dec->eos_cond);
  dec->adapter = gst_adapter_new ();
}
开发者ID:rss351,项目名称:gst-droid,代码行数:18,代码来源:gstdroidadec.c


示例7: gst_wavpack_dec_init

static void
gst_wavpack_dec_init (GstWavpackDec * dec)
{
  dec->context = NULL;
  dec->stream_reader = gst_wavpack_stream_reader_new ();

  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);

  gst_wavpack_dec_reset (dec);
}
开发者ID:Lachann,项目名称:gst-plugins-good,代码行数:10,代码来源:gstwavpackdec.c


示例8: gst_opus_dec_init

static void
gst_opus_dec_init (GstOpusDec * dec)
{
  dec->use_inband_fec = FALSE;
  dec->apply_gain = DEFAULT_APPLY_GAIN;

  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);

  gst_opus_dec_reset (dec);
}
开发者ID:Distrotech,项目名称:gst-plugins-bad,代码行数:10,代码来源:gstopusdec.c


示例9: gst_sbc_dec_init

static void
gst_sbc_dec_init (GstSbcDec * dec)
{
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
  gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
      (dec), TRUE);
  GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec));

  dec->samples_per_frame = 0;
  dec->frame_len = 0;
}
开发者ID:0p1pp1,项目名称:gst-plugins-bad,代码行数:11,代码来源:gstsbcdec.c


示例10: gst_ffmpegauddec_init

static void
gst_ffmpegauddec_init (GstFFMpegAudDec * ffmpegdec)
{
  GstFFMpegAudDecClass *klass =
      (GstFFMpegAudDecClass *) G_OBJECT_GET_CLASS (ffmpegdec);

  /* some ffmpeg data */
  ffmpegdec->context = avcodec_alloc_context3 (klass->in_plugin);
  ffmpegdec->context->opaque = ffmpegdec;
  ffmpegdec->opened = FALSE;

  ffmpegdec->frame = av_frame_alloc ();

  GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (ffmpegdec));
  gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
      (ffmpegdec), TRUE);

  gst_audio_decoder_set_drainable (GST_AUDIO_DECODER (ffmpegdec), TRUE);
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (ffmpegdec), TRUE);
}
开发者ID:GStreamer,项目名称:gst-libav,代码行数:20,代码来源:gstavauddec.c


示例11: gst_ffmpegauddec_get_buffer

/* called when ffmpeg wants us to allocate a buffer to write the decoded frame
 * into. We try to give it memory from our pool */
static int
gst_ffmpegauddec_get_buffer (AVCodecContext * context, AVFrame * frame)
{
  GstFFMpegAudDec *ffmpegdec;
  GstAudioInfo *info;
  BufferInfo *buffer_info;

  ffmpegdec = (GstFFMpegAudDec *) context->opaque;
  if (G_UNLIKELY (!gst_ffmpegauddec_negotiate (ffmpegdec, FALSE)))
    goto negotiate_failed;

  /* Always use the default allocator for planar audio formats because
   * we will have to copy and deinterleave later anyway */
  if (av_sample_fmt_is_planar (ffmpegdec->context->sample_fmt))
    goto fallback;

  info = gst_audio_decoder_get_audio_info (GST_AUDIO_DECODER (ffmpegdec));

  buffer_info = g_slice_new (BufferInfo);
  buffer_info->buffer =
      gst_audio_decoder_allocate_output_buffer (GST_AUDIO_DECODER (ffmpegdec),
      frame->nb_samples * info->bpf);
  gst_buffer_map (buffer_info->buffer, &buffer_info->map, GST_MAP_WRITE);
  frame->opaque = buffer_info;
  frame->data[0] = buffer_info->map.data;
  frame->extended_data = frame->data;
  frame->linesize[0] = buffer_info->map.size;
  frame->type = FF_BUFFER_TYPE_USER;

  return 0;
  /* fallbacks */
negotiate_failed:
  {
    GST_DEBUG_OBJECT (ffmpegdec, "negotiate failed");
    goto fallback;
  }
fallback:
  {
    return avcodec_default_get_buffer (context, frame);
  }
}
开发者ID:cablelabs,项目名称:gst-libav,代码行数:43,代码来源:gstavauddec.c


示例12: gst_speex_dec_init

static void
gst_speex_dec_init (GstSpeexDec * dec)
{
  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
  gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
      (dec), TRUE);
  GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec));

  dec->enh = DEFAULT_ENH;

  gst_speex_dec_reset (dec);
}
开发者ID:pexip,项目名称:gst-plugins-good,代码行数:12,代码来源:gstspeexdec.c


示例13: gst_opus_dec_init

static void
gst_opus_dec_init (GstOpusDec * dec)
{
  dec->use_inband_fec = FALSE;
  dec->apply_gain = DEFAULT_APPLY_GAIN;

  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
  gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
      (dec), TRUE);
  GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec));

  gst_opus_dec_reset (dec);
}
开发者ID:GrokImageCompression,项目名称:gst-plugins-base,代码行数:13,代码来源:gstopusdec.c


示例14: gst_wavpack_dec_init

static void
gst_wavpack_dec_init (GstWavpackDec * dec)
{
  dec->context = NULL;
  dec->stream_reader = gst_wavpack_stream_reader_new ();

  gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
  gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
      (dec), TRUE);
  GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec));

  gst_wavpack_dec_reset (dec);
}
开发者ID:DylanZA,项目名称:gst-plugins-good,代码行数:13,代码来源:gstwavpackdec.c


示例15: gst_a52dec_update_streaminfo

static void
gst_a52dec_update_streaminfo (GstA52Dec * a52dec)
{
  GstTagList *taglist;

  taglist = gst_tag_list_new_empty ();
  gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE,
      (guint) a52dec->bit_rate, NULL);

  gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (a52dec), taglist,
      GST_TAG_MERGE_REPLACE);
  gst_tag_list_unref (taglist);
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:13,代码来源:gsta52dec.c


示例16: gst_dtsdec_update_streaminfo

static void
gst_dtsdec_update_streaminfo (GstDtsDec * dts)
{
  GstTagList *taglist;

  if (dts->bit_rate > 3) {
    taglist = gst_tag_list_new_empty ();
    /* 1 => open bitrate, 2 => variable bitrate, 3 => lossless */
    gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_BITRATE,
        (guint) dts->bit_rate, NULL);
    gst_audio_decoder_merge_tags (GST_AUDIO_DECODER (dts), taglist,
        GST_TAG_MERGE_REPLACE);
  }
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:14,代码来源:gstdtsdec.c


示例17: gst_imx_audio_uniaudio_dec_init

void gst_imx_audio_uniaudio_dec_init(GstImxAudioUniaudioDec *imx_decoder)
{
	GstAudioDecoder *base = GST_AUDIO_DECODER(imx_decoder);
	gst_audio_decoder_set_drainable(base, TRUE);
	gst_audio_decoder_set_plc_aware(base, FALSE);

	imx_decoder->codec = NULL;
	imx_decoder->handle = NULL;
	imx_decoder->original_channel_positions = NULL;
	imx_decoder->reordered_channel_positions = NULL;
	imx_decoder->out_adapter = gst_adapter_new();
	imx_decoder->skip_header_counter = 0;
	imx_decoder->codec_data = NULL;
}
开发者ID:Freescale,项目名称:gstreamer-imx,代码行数:14,代码来源:uniaudio_decoder.c


示例18: gst_amc_audio_dec_set_src_caps

static gboolean
gst_amc_audio_dec_set_src_caps (GstAmcAudioDec * self, GstAmcFormat * format)
{
  gint rate, channels;
  guint32 channel_mask = 0;
  GstAudioChannelPosition to[64];
  GError *err = NULL;

  if (!gst_amc_format_get_int (format, "sample-rate", &rate, &err) ||
      !gst_amc_format_get_int (format, "channel-count", &channels, &err)) {
    GST_ERROR_OBJECT (self, "Failed to get output format metadata: %s",
        err->message);
    g_clear_error (&err);
    return FALSE;
  }

  if (rate == 0 || channels == 0) {
    GST_ERROR_OBJECT (self, "Rate or channels not set");
    return FALSE;
  }

  /* Not always present */
  if (gst_amc_format_contains_key (format, "channel-mask", NULL))
    gst_amc_format_get_int (format, "channel-mask", (gint *) & channel_mask,
        NULL);

  gst_amc_audio_channel_mask_to_positions (channel_mask, channels,
      self->positions);
  memcpy (to, self->positions, sizeof (to));
  gst_audio_channel_positions_to_valid_order (to, channels);
  self->needs_reorder =
      (memcmp (self->positions, to,
          sizeof (GstAudioChannelPosition) * channels) != 0);
  if (self->needs_reorder)
    gst_audio_get_channel_reorder_map (channels, self->positions, to,
        self->reorder_map);

  gst_audio_info_init (&self->info);
  gst_audio_info_set_format (&self->info, GST_AUDIO_FORMAT_S16, rate, channels,
      to);

  if (!gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (self),
          &self->info))
    return FALSE;

  self->input_caps_changed = FALSE;

  return TRUE;
}
开发者ID:Distrotech,项目名称:gst-plugins-bad,代码行数:49,代码来源:gstamcaudiodec.c


示例19: gst_droidadec_finalize

static void
gst_droidadec_finalize (GObject * object)
{
  GstDroidADec *dec = GST_DROIDADEC (object);

  GST_DEBUG_OBJECT (dec, "finalize");

  gst_droidadec_stop (GST_AUDIO_DECODER (dec));

  g_mutex_clear (&dec->eos_lock);
  g_cond_clear (&dec->eos_cond);

  gst_object_unref (dec->adapter);
  dec->adapter = NULL;

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
开发者ID:rss351,项目名称:gst-droid,代码行数:17,代码来源:gstdroidadec.c


示例20: vorbis_handle_identification_packet

static GstFlowReturn
vorbis_handle_identification_packet (GstVorbisDec * vd)
{
  GstAudioInfo info;

  switch (vd->vi.channels) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    case 7:
    case 8:
    {
      const GstAudioChannelPosition *pos;

      pos = gst_vorbis_default_channel_positions[vd->vi.channels - 1];
      gst_audio_info_set_format (&info, GST_VORBIS_AUDIO_FORMAT, vd->vi.rate,
          vd->vi.channels, pos);
      break;
    }
    default:{
      GstAudioChannelPosition position[64];
      gint i, max_pos = MAX (vd->vi.channels, 64);

      GST_ELEMENT_WARNING (vd, STREAM, DECODE,
          (NULL), ("Using NONE channel layout for more than 8 channels"));
      for (i = 0; i < max_pos; i++)
        position[i] = GST_AUDIO_CHANNEL_POSITION_NONE;
      gst_audio_info_set_format (&info, GST_VORBIS_AUDIO_FORMAT, vd->vi.rate,
          vd->vi.channels, position);
      break;
    }
  }

  gst_audio_decoder_set_output_format (GST_AUDIO_DECODER (vd), &info);

  vd->info = info;
  /* select a copy_samples function, this way we can have specialized versions
   * for mono/stereo and avoid the depth switch in tremor case */
  vd->copy_samples = gst_vorbis_get_copy_sample_func (info.channels);

  return GST_FLOW_OK;
}
开发者ID:Lachann,项目名称:gst-plugins-base,代码行数:45,代码来源:gstvorbisdec.c



注:本文中的GST_AUDIO_DECODER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GST_AUDIO_INFO_CHANNELS函数代码示例发布时间:2022-05-30
下一篇:
C++ GST_APP_SRC函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap