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

C++ GST_IS_CAPS函数代码示例

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

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



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

示例1: gst_pb_utils_add_codec_description_to_tag_list

/**
 * gst_pb_utils_add_codec_description_to_tag_list:
 * @taglist: a #GstTagList
 * @codec_tag: a GStreamer codec tag such as #GST_TAG_AUDIO_CODEC,
 *             #GST_TAG_VIDEO_CODEC or #GST_TAG_CODEC
 * @caps: the (fixed) #GstCaps for which a codec tag should be added.
 *
 * Adds a codec tag describing the format specified by @caps to @taglist.
 *
 * Returns: TRUE if a codec tag was added, FALSE otherwise.
 */
gboolean
gst_pb_utils_add_codec_description_to_tag_list (GstTagList * taglist,
    const gchar * codec_tag, const GstCaps * caps)
{
  const FormatInfo *info;
  gchar *desc;

  g_return_val_if_fail (taglist != NULL, FALSE);
  g_return_val_if_fail (GST_IS_TAG_LIST (taglist), FALSE);
  g_return_val_if_fail (codec_tag != NULL, FALSE);
  g_return_val_if_fail (gst_tag_exists (codec_tag), FALSE);
  g_return_val_if_fail (gst_tag_get_type (codec_tag) == G_TYPE_STRING, FALSE);
  g_return_val_if_fail (caps != NULL, FALSE);
  g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);

  info = find_format_info (caps);
  if (info == NULL)
    return FALSE;

  desc = format_info_get_desc (info, caps);
  gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, codec_tag, desc, NULL);
  g_free (desc);

  return TRUE;
}
开发者ID:adenexter,项目名称:gst-plugins-base,代码行数:36,代码来源:descriptions.c


示例2: gst_pb_utils_get_encoder_description

/**
 * gst_pb_utils_get_encoder_description:
 * @caps: the (fixed) #GstCaps for which an encoder description is needed
 *
 * Returns a localised string describing an encoder for the format specified
 * in @caps, for use in error dialogs or other messages to be seen by the user.
 * Should never return NULL unless @factory_name or @caps are invalid.
 *
 * This function is mainly for internal use, applications would typically
 * use gst_missing_plugin_message_get_description() to get a description of
 * a missing feature from a missing-plugin message.
 *
 * Returns: a newly-allocated description string, or NULL on error. Free
 *          string with g_free() when not needed any longer.
 */
gchar *
gst_pb_utils_get_encoder_description (const GstCaps * caps)
{
  gchar *str, *ret;
  GstCaps *tmp;

  g_return_val_if_fail (caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
  tmp = copy_and_clean_caps (caps);
  g_return_val_if_fail (gst_caps_is_fixed (tmp), NULL);

  /* special-case RTP caps */
  if (caps_are_rtp_caps (tmp, "video", &str)) {
    ret = g_strdup_printf (_("%s video RTP payloader"), str);
  } else if (caps_are_rtp_caps (tmp, "audio", &str)) {
    ret = g_strdup_printf (_("%s audio RTP payloader"), str);
  } else if (caps_are_rtp_caps (tmp, "application", &str)) {
    ret = g_strdup_printf (_("%s RTP payloader"), str);
  } else {
    const FormatInfo *info;

    str = gst_pb_utils_get_codec_description (tmp);
    info = find_format_info (tmp);
    if (info != NULL && (info->flags & FLAG_CONTAINER) != 0) {
      ret = g_strdup_printf (_("%s muxer"), str);
    } else {
      ret = g_strdup_printf (_("%s encoder"), str);
    }
  }

  g_free (str);
  gst_caps_unref (tmp);

  return ret;
}
开发者ID:adenexter,项目名称:gst-plugins-base,代码行数:50,代码来源:descriptions.c


示例3: gst_vaapi_decoder_new

GstVaapiDecoder *
gst_vaapi_decoder_new (const GstVaapiDecoderClass * klass,
    GstVaapiDisplay * display, GstCaps * caps)
{
  GstVaapiDecoder *decoder;

  g_return_val_if_fail (display != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (caps), NULL);

  decoder = (GstVaapiDecoder *)
      gst_vaapi_mini_object_new (GST_VAAPI_MINI_OBJECT_CLASS (klass));
  if (!decoder)
    return NULL;

  if (!gst_vaapi_decoder_init (decoder, display, caps))
    goto error;
  return decoder;

  /* ERRORS */
error:
  {
    gst_vaapi_decoder_unref (decoder);
    return NULL;
  }
}
开发者ID:GStreamer,项目名称:gstreamer-vaapi,代码行数:25,代码来源:gstvaapidecoder.c


示例4: gst_missing_encoder_message_new

/**
 * gst_missing_encoder_message_new:
 * @element: the #GstElement posting the message
 * @encode_caps: the (fixed) caps for which an encoder element is needed
 *
 * Creates a missing-plugin message for @element to notify the application
 * that an encoder element for a particular set of (fixed) caps is missing.
 * This function is mainly for use in plugins.
 *
 * Returns: (transfer full): a new #GstMessage, or NULL on error
 */
GstMessage *
gst_missing_encoder_message_new (GstElement * element,
    const GstCaps * encode_caps)
{
  GstStructure *s;
  GstCaps *caps;
  gchar *description;

  g_return_val_if_fail (element != NULL, NULL);
  g_return_val_if_fail (GST_IS_ELEMENT (element), NULL);
  g_return_val_if_fail (encode_caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_any (encode_caps), NULL);
  g_return_val_if_fail (!gst_caps_is_empty (encode_caps), NULL);
  g_return_val_if_fail (gst_caps_is_fixed (encode_caps), NULL);

  description = gst_pb_utils_get_encoder_description (encode_caps);
  caps = copy_and_clean_caps (encode_caps);

  s = gst_structure_new ("missing-plugin", "type", G_TYPE_STRING,
      "encoder", "detail", GST_TYPE_CAPS, caps, "name", G_TYPE_STRING,
      description, NULL);

  gst_caps_unref (caps);
  g_free (description);

  return gst_message_new_element (GST_OBJECT_CAST (element), s);
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:39,代码来源:missing-plugins.c


示例5: getVideoSizeAndFormatFromCaps

bool getVideoSizeAndFormatFromCaps(GstCaps* caps, WebCore::IntSize& size, GstVideoFormat& format, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride)
{
#ifdef GST_API_VERSION_1
    GstVideoInfo info;
    if (!gst_video_info_from_caps(&info, caps))
        return false;

    format = GST_VIDEO_INFO_FORMAT(&info);
    size.setWidth(GST_VIDEO_INFO_WIDTH(&info));
    size.setHeight(GST_VIDEO_INFO_HEIGHT(&info));
    pixelAspectRatioNumerator = GST_VIDEO_INFO_PAR_N(&info);
    pixelAspectRatioDenominator = GST_VIDEO_INFO_PAR_D(&info);
    stride = GST_VIDEO_INFO_PLANE_STRIDE(&info, 0);
#else
    gint width, height;
    if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps)
        || !gst_video_format_parse_caps(caps, &format, &width, &height)
        || !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
                                                    &pixelAspectRatioDenominator))
        return false;
    size.setWidth(width);
    size.setHeight(height);
    stride = size.width() * 4;
#endif

    return true;
}
开发者ID:dog-god,项目名称:iptv,代码行数:27,代码来源:GStreamerVersioning.cpp


示例6: gst_codec_utils_h265_caps_set_level_tier_and_profile

/**
 * gst_codec_utils_h265_caps_set_level_tier_and_profile:
 * @caps: the #GstCaps to which the level, tier and profile are to be added
 * @profile_tier_level: Pointer to the profile_tier_level struct
 * @len: Length of the data available in @profile_tier_level.
 *
 * Sets the level, tier and profile in @caps if it can be determined from
 * @profile_tier_level. See gst_codec_utils_h265_get_level(),
 * gst_codec_utils_h265_get_tier() and gst_codec_utils_h265_get_profile()
 * for more details on the parameters.
 *
 * Returns: %TRUE if the level, tier, profile could be set, %FALSE otherwise.
 *
 * Since 1.4
 */
gboolean
gst_codec_utils_h265_caps_set_level_tier_and_profile (GstCaps * caps,
    const guint8 * profile_tier_level, guint len)
{
  const gchar *level, *tier, *profile;

  g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);
  g_return_val_if_fail (GST_CAPS_IS_SIMPLE (caps), FALSE);
  g_return_val_if_fail (GST_SIMPLE_CAPS_HAS_NAME (caps, "video/x-h265"), FALSE);
  g_return_val_if_fail (profile_tier_level != NULL, FALSE);

  level = gst_codec_utils_h265_get_level (profile_tier_level, len);
  if (level != NULL)
    gst_caps_set_simple (caps, "level", G_TYPE_STRING, level, NULL);

  tier = gst_codec_utils_h265_get_tier (profile_tier_level, len);
  if (tier != NULL)
    gst_caps_set_simple (caps, "tier", G_TYPE_STRING, tier, NULL);

  profile = gst_codec_utils_h265_get_profile (profile_tier_level, len);
  if (profile != NULL)
    gst_caps_set_simple (caps, "profile", G_TYPE_STRING, profile, NULL);

  GST_LOG ("profile : %s", (profile) ? profile : "---");
  GST_LOG ("tier    : %s", (tier) ? tier : "---");
  GST_LOG ("level   : %s", (level) ? level : "---");

  return (level != NULL && tier != NULL && profile != NULL);
}
开发者ID:Acidburn0zzz,项目名称:gstreamer-libde265,代码行数:44,代码来源:codec-utils.c


示例7: setFilter

/*!
 * \brief OpenIMAJCapGStreamer::setFilter
 * \param prop the property name
 * \param type glib property type
 * \param v1 the value
 * \param v2 second value of property type requires it, else NULL
 * Filter the output formats by setting appsink caps properties
 */
void OpenIMAJCapGStreamer::setFilter(const char *prop, GType type, int v1, int v2)
{
    if(!caps || !( GST_IS_CAPS (caps) ))
    {
        if(type == G_TYPE_INT)
        {
            caps = gst_caps_new_simple("video/x-raw","format",G_TYPE_STRING,"BGR", prop, type, v1, NULL);
        }
        else
        {
            caps = gst_caps_new_simple("video/x-raw","format",G_TYPE_STRING,"BGR", prop, type, v1, v2, NULL);
        }
    }
    else
    {
        if (! gst_caps_is_writable(caps))
            caps = gst_caps_make_writable (caps);
        if(type == G_TYPE_INT){
            gst_caps_set_simple(caps, prop, type, v1, NULL);
        }else{
            gst_caps_set_simple(caps, prop, type, v1, v2, NULL);
        }
    }
    
    caps = gst_caps_fixate(caps);
    
    gst_app_sink_set_caps(GST_APP_SINK(sink), caps);
}
开发者ID:Garfield2005,项目名称:openimaj,代码行数:36,代码来源:OpenIMAJ_GStreamer.cpp


示例8: IntSize

// Returns the size of the video
IntSize MediaPlayerPrivate::naturalSize() const
{
    if (!hasVideo())
        return IntSize();

    // TODO: handle possible clean aperture data. See
    // https://bugzilla.gnome.org/show_bug.cgi?id=596571
    // TODO: handle possible transformation matrix. See
    // https://bugzilla.gnome.org/show_bug.cgi?id=596326
    int width = 0, height = 0;
    if (GstPad* pad = gst_element_get_static_pad(m_videoSink, "sink")) {
        GstCaps* caps = GST_PAD_CAPS(pad);
        gfloat pixelAspectRatio;
        gint pixelAspectRatioNumerator, pixelAspectRatioDenominator;

        if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps) ||
            !gst_video_format_parse_caps(caps, NULL, &width, &height) ||
            !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
                                                           &pixelAspectRatioDenominator)) {
            gst_object_unref(GST_OBJECT(pad));
            return IntSize();
        }

        pixelAspectRatio = (gfloat) pixelAspectRatioNumerator / (gfloat) pixelAspectRatioDenominator;
        width *= pixelAspectRatio;
        height /= pixelAspectRatio;
        gst_object_unref(GST_OBJECT(pad));
    }

    return IntSize(width, height);
}
开发者ID:Androtos,项目名称:toolchain_benchmark,代码行数:32,代码来源:MediaPlayerPrivateGStreamer.cpp


示例9: gst_pb_utils_get_codec_description

/**
 * gst_pb_utils_get_codec_description:
 * @caps: the (fixed) #GstCaps for which an format description is needed
 *
 * Returns a localised (as far as this is possible) string describing the
 * media format specified in @caps, for use in error dialogs or other messages
 * to be seen by the user. Should never return NULL unless @caps is invalid.
 *
 * Also see the convenience function
 * gst_pb_utils_add_codec_description_to_tag_list().
 *
 * Returns: a newly-allocated description string, or NULL on error. Free
 *          string with g_free() when not needed any longer.
 */
gchar *
gst_pb_utils_get_codec_description (const GstCaps * caps)
{
  const FormatInfo *info;
  gchar *str, *comma;
  GstCaps *tmp;

  g_return_val_if_fail (caps != NULL, NULL);
  g_return_val_if_fail (GST_IS_CAPS (caps), NULL);
  tmp = copy_and_clean_caps (caps);
  g_return_val_if_fail (gst_caps_is_fixed (tmp), NULL);

  info = find_format_info (tmp);

  if (info) {
    str = format_info_get_desc (info, tmp);
  } else {
    str = gst_caps_to_string (tmp);

    /* cut off everything after the media type, if there is anything */
    if ((comma = strchr (str, ','))) {
      *comma = '\0';
      g_strchomp (str);
      /* we could do something more elaborate here, like taking into account
       * audio/, video/, image/ and application/ prefixes etc. */
    }

    GST_WARNING ("No description available for media type: %s", str);
  }
  gst_caps_unref (tmp);

  return str;
}
开发者ID:adenexter,项目名称:gst-plugins-base,代码行数:47,代码来源:descriptions.c


示例10: gst_vdp_yuv_to_video_caps

GstCaps *
gst_vdp_yuv_to_video_caps (GstCaps * yuv_caps)
{
  GstCaps *video_caps;
  gint i;

  g_return_val_if_fail (GST_IS_CAPS (yuv_caps), NULL);

  video_caps = gst_caps_copy (yuv_caps);
  for (i = 0; i < gst_caps_get_size (video_caps); i++) {
    GstStructure *structure;
    guint32 fourcc;
    VdpChromaType chroma_type;

    structure = gst_caps_get_structure (video_caps, i);
    if (!gst_structure_has_name (structure, "video/x-raw-yuv"))
      goto not_yuv_error;

    if (!gst_structure_get_fourcc (structure, "format", &fourcc))
      goto no_format_error;

    chroma_type = -1;
    for (i = 0; i < G_N_ELEMENTS (formats); i++) {
      if (formats[i].fourcc == fourcc) {
        chroma_type = formats[i].chroma_type;
        break;
      }
    }

    if (chroma_type == -1)
      goto no_chroma_error;

    /* now we transform the caps */
    gst_structure_set_name (structure, "video/x-vdpau-video");
    gst_structure_remove_field (structure, "format");
    gst_structure_set (structure, "chroma-type", G_TYPE_INT, chroma_type, NULL);
  }

  return video_caps;

error:
  gst_caps_unref (video_caps);
  return NULL;

not_yuv_error:
  GST_WARNING ("The caps weren't of type \"video/x-raw-yuv\"");
  goto error;

no_format_error:
  GST_WARNING ("The caps didn't have a \"fourcc\" field");
  goto error;

no_chroma_error:
  GST_WARNING ("The caps had an invalid \"fourcc\" field");
  goto error;

}
开发者ID:collects,项目名称:gst-plugins-bad,代码行数:57,代码来源:gstvdputils.c


示例11: gst_encoding_container_profile_new

/**
 * gst_encoding_container_profile_new:
 * @name: (allow-none): The name of the container profile, can be %NULL
 * @description: (allow-none): The description of the container profile,
 *     can be %NULL
 * @format: The format to use for this profile
 * @preset: (allow-none): The preset to use for this profile.
 *
 * Creates a new #GstEncodingContainerProfile.
 *
 * Returns: The newly created #GstEncodingContainerProfile.
 */
GstEncodingContainerProfile *
gst_encoding_container_profile_new (const gchar * name,
    const gchar * description, GstCaps * format, const gchar * preset)
{
  g_return_val_if_fail (GST_IS_CAPS (format), NULL);

  return (GstEncodingContainerProfile *)
      common_creation (GST_TYPE_ENCODING_CONTAINER_PROFILE, format, preset,
      name, description, NULL, 0);
}
开发者ID:GStreamer,项目名称:gst-plugins-base,代码行数:22,代码来源:encoding-profile.c


示例12: update_session_stream_from_caps

/* Create new stream from params in caps
 */
static GstSrtpDecSsrcStream *
update_session_stream_from_caps (GstSrtpDec * filter, guint32 ssrc,
    GstCaps * caps)
{
  GstSrtpDecSsrcStream *stream = NULL;
  GstSrtpDecSsrcStream *old_stream = NULL;
  err_status_t err;

  g_return_val_if_fail (GST_IS_SRTP_DEC (filter), NULL);
  g_return_val_if_fail (GST_IS_CAPS (caps), NULL);

  stream = get_stream_from_caps (filter, caps, ssrc);

  old_stream = find_stream_by_ssrc (filter, ssrc);
  if (stream && old_stream &&
      stream->rtp_cipher == old_stream->rtp_cipher &&
      stream->rtcp_cipher == old_stream->rtcp_cipher &&
      stream->rtp_auth == old_stream->rtp_auth &&
      stream->rtcp_auth == old_stream->rtcp_auth &&
      stream->key && old_stream->key &&
      gst_buffer_get_size (stream->key) ==
      gst_buffer_get_size (old_stream->key)) {
    GstMapInfo info;

    if (gst_buffer_map (old_stream->key, &info, GST_MAP_READ)) {
      gboolean equal;

      equal = (gst_buffer_memcmp (stream->key, 0, info.data, info.size) == 0);
      gst_buffer_unmap (old_stream->key, &info);

      if (equal) {
        free_stream (stream);
        return old_stream;
      }
    }
  }

  /* Remove existing stream, if any */
  gst_srtp_dec_remove_stream (filter, ssrc);

  if (stream) {
    /* Create new session stream */
    err = init_session_stream (filter, ssrc, stream);

    if (err != err_status_ok) {
      if (stream->key)
        gst_buffer_unref (stream->key);
      g_slice_free (GstSrtpDecSsrcStream, stream);
      stream = NULL;
    }
  }

  return stream;
}
开发者ID:fanc999,项目名称:gst-plugins-bad,代码行数:56,代码来源:gstsrtpdec.c


示例13: gst_encoding_profile_set_restriction

/**
 * gst_encoding_profile_set_restriction:
 * @profile: a #GstEncodingProfile
 * @restriction: (transfer full): the restriction to apply
 *
 * Set the restriction #GstCaps to apply before the encoder
 * that will be used in the profile. See gst_encoding_profile_get_restriction()
 * for more about restrictions. Does not apply to #GstEncodingContainerProfile.
 */
void
gst_encoding_profile_set_restriction (GstEncodingProfile * profile,
    GstCaps * restriction)
{
  g_return_if_fail (GST_IS_CAPS (restriction));
  g_return_if_fail (GST_IS_ENCODING_PROFILE (profile));

  if (profile->restriction)
    gst_caps_unref (profile->restriction);
  profile->restriction = restriction;

  g_object_notify_by_pspec (G_OBJECT (profile),
      _properties[PROP_RESTRICTION_CAPS]);
}
开发者ID:GStreamer,项目名称:gst-plugins-base,代码行数:23,代码来源:encoding-profile.c


示例14: gst_my_base_source_class_add_pad_template

/*
 * Boilerplates BaseSrc add pad.
 */
void
gst_my_base_source_class_add_pad_template (GstBaseSrcClass * base_class,
    GstCaps * srccaps)
{
  GstElementClass *elem_class = GST_ELEMENT_CLASS (base_class);
  GstPadTemplate *pad_template;

  g_return_if_fail (GST_IS_CAPS (srccaps));

  pad_template =
      gst_pad_template_new (GST_BASE_TRANSFORM_SRC_NAME, GST_PAD_SRC,
      GST_PAD_ALWAYS, srccaps);
  gst_element_class_add_pad_template (elem_class, pad_template);
}
开发者ID:0p1pp1,项目名称:gst-plugins-bad,代码行数:17,代码来源:gstladspasource.c


示例15: gst_raw_parse_class_set_src_pad_template

void
gst_raw_parse_class_set_src_pad_template (GstRawParseClass * klass,
    const GstCaps * allowed_caps)
{
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);

  g_return_if_fail (GST_IS_RAW_PARSE_CLASS (klass));
  g_return_if_fail (allowed_caps != NULL);
  g_return_if_fail (GST_IS_CAPS (allowed_caps));

  gst_element_class_add_pad_template (element_class,
      gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
          gst_caps_copy (allowed_caps)));
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:14,代码来源:gstrawparse.c


示例16: on_caps

static void on_caps(GstElement *sink, GParamSpec *pspec, OwrMediaRenderer *media_renderer)
{
    GstCaps *caps;

    OWR_UNUSED(pspec);

    g_object_get(sink, "caps", &caps, NULL);

    if (GST_IS_CAPS(caps)) {
        GST_INFO_OBJECT(media_renderer, "%s renderer - configured with caps: %" GST_PTR_FORMAT,
                        media_renderer->priv->media_type == OWR_MEDIA_TYPE_AUDIO ? "Audio" :
                        media_renderer->priv->media_type == OWR_MEDIA_TYPE_VIDEO ? "Video" :
                        "Unknown", caps);
    }
}
开发者ID:barmi,项目名称:openwebrtc,代码行数:15,代码来源:owr_media_renderer.c


示例17: on_caps

static void on_caps(GstElement *source, GParamSpec *pspec, OwrMediaSource *media_source)
{
    gchar *media_source_name;
    GstCaps *caps;

    OWR_UNUSED(pspec);

    g_object_get(source, "caps", &caps, NULL);
    g_object_get(media_source, "name", &media_source_name, NULL);

    if (GST_IS_CAPS(caps)) {
        GST_INFO_OBJECT(source, "%s - configured with caps: %" GST_PTR_FORMAT,
            media_source_name, caps);
    }
}
开发者ID:Metrological,项目名称:openwebrtc,代码行数:15,代码来源:owr_local_media_source.c


示例18: gtk_gst_widget_set_caps

gboolean
gtk_gst_widget_set_caps (GtkGstWidget * widget, GstCaps * caps)
{
  GMainContext *main_context = g_main_context_default ();
  GstVideoInfo v_info;

  g_return_val_if_fail (GTK_IS_GST_WIDGET (widget), FALSE);
  g_return_val_if_fail (GST_IS_CAPS (caps), FALSE);
  g_return_val_if_fail (gst_caps_is_fixed (caps), FALSE);

  if (widget->priv->caps && gst_caps_is_equal_fixed (widget->priv->caps, caps))
    return TRUE;

  if (!gst_video_info_from_caps (&v_info, caps))
    return FALSE;

  /* FIXME: support other formats */
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
  g_return_val_if_fail (GST_VIDEO_INFO_FORMAT (&v_info) ==
      GST_VIDEO_FORMAT_BGRA || GST_VIDEO_INFO_FORMAT (&v_info) ==
      GST_VIDEO_FORMAT_BGRx, FALSE);
#else
  g_return_val_if_fail (GST_VIDEO_INFO_FORMAT (&v_info) ==
      GST_VIDEO_FORMAT_ARGB || GST_VIDEO_INFO_FORMAT (&v_info) ==
      GST_VIDEO_FORMAT_xRGB, FALSE);
#endif

  g_mutex_lock (&widget->priv->lock);

  if (!_calculate_par (widget, &v_info)) {
    g_mutex_unlock (&widget->priv->lock);
    return FALSE;
  }

  gst_caps_replace (&widget->priv->caps, caps);
  widget->priv->v_info = v_info;
  widget->priv->negotiated = TRUE;

  g_mutex_unlock (&widget->priv->lock);

  gtk_widget_queue_resize (GTK_WIDGET (widget));

  g_main_context_invoke (main_context, (GSourceFunc) _queue_resize, widget);

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


示例19: pb_utils_get_file_extension_from_caps

const gchar *
pb_utils_get_file_extension_from_caps (const GstCaps * caps)
{
  const FormatInfo *info;
  const gchar *ext = NULL;
  GstCaps *stripped_caps;

  g_assert (GST_IS_CAPS (caps));

  stripped_caps = copy_and_clean_caps (caps);

  g_assert (gst_caps_is_fixed (stripped_caps));

  info = find_format_info (stripped_caps);

  if (info && info->ext[0] != '\0') {
    ext = info->ext;
  } else if (info && info->desc == NULL) {
    const GstStructure *s;

    s = gst_caps_get_structure (stripped_caps, 0);

    /* cases where we have to evaluate the caps more closely */
    if (strcmp (info->type, "audio/mpeg") == 0) {
      int version = 0, layer = 3;

      if (gst_structure_get_int (s, "mpegversion", &version)) {
        if (version == 2 || version == 4) {
          ext = "aac";
        } else if (version == 1) {
          gst_structure_get_int (s, "layer", &layer);
          if (layer == 1)
            ext = "mp1";
          else if (layer == 2)
            ext = "mp2";
          else
            ext = "mp3";
        }
      }
    }
  }

  gst_caps_unref (stripped_caps);
  return ext;
}
开发者ID:MathieuDuponchelle,项目名称:gst-plugins-base,代码行数:45,代码来源:descriptions.c


示例20: gstreamer_get_video_dimensions

extern void gstreamer_get_video_dimensions(int *widthp, int *heightp) {
	const char *format = NULL;
	*widthp = 0;
	*heightp = 0;
	int framerate_numerator = 0;
	int framerate_denom = 0;
	int pixel_aspect_ratio_num = 0;
	int pixel_aspect_ratio_denom = 0;
	GList *list = g_list_first(created_pads_list);
	while (list != NULL) {
		GstPad *pad = list->data;
		GstCaps *caps = gst_pad_get_current_caps(pad);
		if (GST_IS_CAPS(caps))
			read_video_props(caps, &format, widthp, heightp, &framerate_numerator,
				&framerate_denom, &pixel_aspect_ratio_num,
				&pixel_aspect_ratio_denom);
		list = g_list_next(list);
	}
}
开发者ID:BorodaZizitopa,项目名称:gstplay,代码行数:19,代码来源:gstreamer.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GST_IS_ELEMENT_FACTORY函数代码示例发布时间:2022-05-30
下一篇:
C++ GST_IS_BIN函数代码示例发布时间: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