当前位置: 首页>>代码示例>>C++>>正文


C++ GST_MINI_OBJECT_CAST函数代码示例

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


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

示例1: mxf_up_get_rgba_descriptor

static MXFMetadataFileDescriptor *
mxf_up_get_rgba_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
    MXFEssenceElementWriteFunc * handler, gpointer * mapping_data)
{
  MXFMetadataRGBAPictureEssenceDescriptor *ret;
  guint i;
  GstCaps *tmp, *intersection;
  MXFUPMappingData *md = g_new0 (MXFUPMappingData, 1);

  *mapping_data = md;

  ret = (MXFMetadataRGBAPictureEssenceDescriptor *)
      gst_mini_object_new (MXF_TYPE_METADATA_RGBA_PICTURE_ESSENCE_DESCRIPTOR);

  for (i = 0; i < G_N_ELEMENTS (_rgba_mapping_table); i++) {
    tmp = gst_caps_from_string (_rgba_mapping_table[i].caps);
    intersection = gst_caps_intersect (caps, tmp);
    gst_caps_unref (tmp);

    if (!gst_caps_is_empty (intersection)) {
      gst_caps_unref (intersection);
      ret->n_pixel_layout = _rgba_mapping_table[i].n_pixel_layout;
      ret->pixel_layout = g_new0 (guint8, ret->n_pixel_layout * 2);
      md->fourcc = _rgba_mapping_table[i].fourcc;
      md->bpp = _rgba_mapping_table[i].n_pixel_layout;
      memcpy (ret->pixel_layout, _rgba_mapping_table[i].pixel_layout,
          ret->n_pixel_layout * 2);
      break;
    }
    gst_caps_unref (intersection);
  }

  if (md->fourcc == 0) {
    GST_ERROR ("Invalid caps %" GST_PTR_FORMAT, caps);
    gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret));
    return NULL;
  }


  memcpy (&ret->parent.parent.essence_container, &up_essence_container_ul, 16);

  if (!mxf_metadata_generic_picture_essence_descriptor_from_caps (&ret->parent,
          caps)) {
    gst_mini_object_unref (GST_MINI_OBJECT_CAST (ret));
    return NULL;
  }

  md->width = ret->parent.stored_width;
  md->height = ret->parent.stored_height;

  *handler = mxf_up_write_func;

  return (MXFMetadataFileDescriptor *) ret;
}
开发者ID:pli3,项目名称:gst-plugins-bad,代码行数:54,代码来源:mxfup.c

示例2: print_buffer_metadata

static void print_buffer_metadata(WebKitVideoSink* sink, GstBuffer* buffer)
{
    gchar dts_str[64], pts_str[64], dur_str[64];
    gchar flag_str[100];

    if (GST_BUFFER_DTS (buffer) != GST_CLOCK_TIME_NONE) {
        g_snprintf (dts_str, sizeof (dts_str), "%" GST_TIME_FORMAT,
                    GST_TIME_ARGS (GST_BUFFER_DTS (buffer)));
    } else {
        g_strlcpy (dts_str, "none", sizeof (dts_str));
    }

    if (GST_BUFFER_PTS (buffer) != GST_CLOCK_TIME_NONE) {
        g_snprintf (pts_str, sizeof (pts_str), "%" GST_TIME_FORMAT,
                    GST_TIME_ARGS (GST_BUFFER_PTS (buffer)));
    } else {
        g_strlcpy (pts_str, "none", sizeof (pts_str));
    }

    if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE) {
        g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
                    GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)));
    } else {
        g_strlcpy (dur_str, "none", sizeof (dur_str));
    }

    {
        const char *flag_list[15] = {
            "", "", "", "", "live", "decode-only", "discont", "resync", "corrupted",
            "marker", "header", "gap", "droppable", "delta-unit", "in-caps"
        };
        guint i;
        char *end = flag_str;
        end[0] = '\0';
        for (i = 0; i < G_N_ELEMENTS (flag_list); i++) {
            if (GST_MINI_OBJECT_CAST (buffer)->flags & (1 << i)) {
                strcpy (end, flag_list[i]);
                end += strlen (end);
                end[0] = ' ';
                end[1] = '\0';
                end++;
            }
        }
    }

    g_printerr ("chain   ******* (%s:%s) (%u bytes, dts: %s, pts: %s"
                ", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
                G_GINT64_FORMAT ", flags: %08x %s) %p\n",
                    GST_DEBUG_PAD_NAME (GST_BASE_SINK_CAST (sink)->sinkpad),
                (guint) gst_buffer_get_size (buffer), dts_str, pts_str,
                dur_str, GST_BUFFER_OFFSET (buffer), GST_BUFFER_OFFSET_END (buffer),
                GST_MINI_OBJECT_CAST (buffer)->flags, flag_str, buffer);
}
开发者ID:ceyusa,项目名称:gst-wk,代码行数:53,代码来源:VideoSinkGStreamer.c

示例3: events_cb

static GstPadProbeReturn
events_cb (GstPad * pad, GstPadProbeInfo * probe_info, gpointer user_data)
{
    APP_STATE_T *state = (APP_STATE_T *) user_data;
    GstEvent *event = GST_PAD_PROBE_INFO_EVENT (probe_info);

    switch (GST_EVENT_TYPE (event)) {
    case GST_EVENT_CAPS:
    {
        if (state->caps) {
            gst_caps_unref (state->caps);
            state->caps = NULL;
        }
        gst_event_parse_caps (event, &state->caps);
        if (state->caps)
            gst_caps_ref (state->caps);
        break;
    }
    case GST_EVENT_FLUSH_START:
        flush_start (state);
        break;
    case GST_EVENT_FLUSH_STOP:
        flush_stop (state);
        break;
    case GST_EVENT_EOS:
        queue_object (state, GST_MINI_OBJECT_CAST (gst_event_ref (event)), FALSE);
        break;
    default:
        break;
    }

    return GST_PAD_PROBE_OK;
}
开发者ID:ryumiel,项目名称:gst-omx,代码行数:33,代码来源:testegl.c

示例4: gst_value_mini_object_free

static void
gst_value_mini_object_free (GValue * value)
{
  if (value->data[0].v_pointer) {
    gst_mini_object_unref (GST_MINI_OBJECT_CAST (value->data[0].v_pointer));
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:7,代码来源:gstminiobject.c

示例5: gst_mini_object_init

static void
gst_mini_object_init (GTypeInstance * instance, gpointer klass)
{
  GstMiniObject *mini_object = GST_MINI_OBJECT_CAST (instance);

  mini_object->refcount = 1;
}
开发者ID:zsx,项目名称:ossbuild,代码行数:7,代码来源:gstminiobject.c

示例6: gst_fake_sink_render

static GstFlowReturn
gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
{
  GstFakeSink *sink = GST_FAKE_SINK_CAST (bsink);

  if (sink->num_buffers_left == 0)
    goto eos;

  if (sink->num_buffers_left != -1)
    sink->num_buffers_left--;

  if (!sink->silent) {
    gchar ts_str[64], dur_str[64];

    GST_OBJECT_LOCK (sink);
    g_free (sink->last_message);

    if (GST_BUFFER_TIMESTAMP (buf) != GST_CLOCK_TIME_NONE) {
      g_snprintf (ts_str, sizeof (ts_str), "%" GST_TIME_FORMAT,
          GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
    } else {
      g_strlcpy (ts_str, "none", sizeof (ts_str));
    }

    if (GST_BUFFER_DURATION (buf) != GST_CLOCK_TIME_NONE) {
      g_snprintf (dur_str, sizeof (dur_str), "%" GST_TIME_FORMAT,
          GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
    } else {
      g_strlcpy (dur_str, "none", sizeof (dur_str));
    }

    sink->last_message =
        g_strdup_printf ("chain   ******* < (%5d bytes, timestamp: %s"
        ", duration: %s, offset: %" G_GINT64_FORMAT ", offset_end: %"
        G_GINT64_FORMAT ", flags: %d) %p", GST_BUFFER_SIZE (buf), ts_str,
        dur_str, GST_BUFFER_OFFSET (buf), GST_BUFFER_OFFSET_END (buf),
        GST_MINI_OBJECT_CAST (buf)->flags, buf);
    GST_OBJECT_UNLOCK (sink);

    gst_fake_sink_notify_last_message (sink);
  }
  if (sink->signal_handoffs)
    g_signal_emit (sink, gst_fake_sink_signals[SIGNAL_HANDOFF], 0, buf,
        bsink->sinkpad);

  if (sink->dump) {
    gst_util_dump_mem (GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
  }
  if (sink->num_buffers_left == 0)
    goto eos;

  return GST_FLOW_OK;

  /* ERRORS */
eos:
  {
    GST_DEBUG_OBJECT (sink, "we are EOS");
    return GST_FLOW_UNEXPECTED;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:60,代码来源:gstfakesink.c

示例7: gst_egl_image_new_wrapped

GstEGLImage *
gst_egl_image_new_wrapped (GstGLContext * context, EGLImageKHR image,
    GstVideoGLTextureType type, GstVideoGLTextureOrientation orientation,
    gpointer user_data, GstEGLImageDestroyNotify user_data_destroy)
{
  GstEGLImage *img = NULL;

  g_return_val_if_fail (context != NULL, NULL);
  g_return_val_if_fail (GST_IS_GL_CONTEXT_EGL (context), NULL);
  g_return_val_if_fail (image != EGL_NO_IMAGE_KHR, NULL);

  img = g_new0 (GstEGLImage, 1);
  gst_mini_object_init (GST_MINI_OBJECT_CAST (img), 0, GST_TYPE_EGL_IMAGE,
      (GstMiniObjectCopyFunction) _gst_egl_image_copy, NULL,
      (GstMiniObjectFreeFunction) _gst_egl_image_free);

  img->context = gst_object_ref (context);
  img->image = image;
  img->type = type;
  img->orientation = orientation;

  img->destroy_data = user_data;
  img->destroy_notify = user_data_destroy;

  return img;
}
开发者ID:justinjoy,项目名称:gst-plugins-bad,代码行数:26,代码来源:gsteglimage.c

示例8: gst_buffer_get_flags_string

/* Returns a newly allocated string describing the flags on this buffer */
char *
gst_buffer_get_flags_string (GstBuffer * buffer)
{
  static const char flag_strings[] =
      "\000\000\000\000live\000decode-only\000discont\000resync\000corrupted\000"
      "marker\000header\000gap\000droppable\000delta-unit\000tag-memory\000"
      "FIXME";
  static const guint8 flag_idx[] = { 0, 1, 2, 3, 4, 9, 21, 29, 36, 46, 53,
    60, 64, 74, 85, 96
  };
  int i, max_bytes;
  char *flag_str, *end;

  /* max size is all flag strings plus a space or terminator after each one */
  max_bytes = sizeof (flag_strings);
  flag_str = g_malloc (max_bytes);

  end = flag_str;
  end[0] = '\0';
  for (i = BUFFER_FLAG_SHIFT; i < G_N_ELEMENTS (flag_idx); i++) {
    if (GST_MINI_OBJECT_CAST (buffer)->flags & (1 << i)) {
      strcpy (end, flag_strings + flag_idx[i]);
      end += strlen (end);
      end[0] = ' ';
      end[1] = '\0';
      end++;
    }
  }

  return flag_str;
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gstreamer,代码行数:32,代码来源:gstelements_private.c

示例9: gst_context_init

static void
gst_context_init (GstContext * context)
{
  gst_mini_object_init (GST_MINI_OBJECT_CAST (context), 0, _gst_context_type,
      (GstMiniObjectCopyFunction) _gst_context_copy, NULL,
      (GstMiniObjectFreeFunction) _gst_context_free);
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gstreamer,代码行数:7,代码来源:gstcontext.c

示例10: gst_memory_init

/**
 * gst_memory_init: (skip)
 * @mem: a #GstMemory
 * @flags: #GstMemoryFlags
 * @allocator: the #GstAllocator
 * @parent: the parent of @mem
 * @maxsize: the total size of the memory
 * @align: the alignment of the memory
 * @offset: The offset in the memory
 * @size: the size of valid data in the memory

 * Initializes a newly allocated @mem with the given parameters. This function
 * will call gst_mini_object_init() with the default memory parameters.
 */
void
gst_memory_init (GstMemory * mem, GstMemoryFlags flags,
    GstAllocator * allocator, GstMemory * parent, gsize maxsize, gsize align,
    gsize offset, gsize size)
{
  gst_mini_object_init (GST_MINI_OBJECT_CAST (mem),
      flags | GST_MINI_OBJECT_FLAG_LOCKABLE, GST_TYPE_MEMORY,
      (GstMiniObjectCopyFunction) _gst_memory_copy, NULL,
      (GstMiniObjectFreeFunction) _gst_memory_free);

  mem->allocator = gst_object_ref (allocator);
  if (parent) {
    gst_memory_lock (parent, GST_LOCK_FLAG_EXCLUSIVE);
    gst_memory_ref (parent);
  }
  mem->parent = parent;
  mem->maxsize = maxsize;
  mem->align = align;
  mem->offset = offset;
  mem->size = size;

  GST_CAT_DEBUG (GST_CAT_MEMORY, "new memory %p, maxsize:%" G_GSIZE_FORMAT
      " offset:%" G_GSIZE_FORMAT " size:%" G_GSIZE_FORMAT, mem, maxsize,
      offset, size);
}
开发者ID:BigBrother-International,项目名称:gstreamer,代码行数:39,代码来源:gstmemory.c

示例11: preroll_cb

static void
preroll_cb (GstElement * fakesink, GstBuffer * buffer, GstPad * pad,
    gpointer user_data)
{
  APP_STATE_T *state = (APP_STATE_T *) user_data;
  queue_object (state, GST_MINI_OBJECT_CAST (gst_buffer_ref (buffer)), FALSE);
}
开发者ID:01org,项目名称:gst-omx,代码行数:7,代码来源:testegl.c

示例12: gst_toc_append_entry

/**
 * gst_toc_append_entry:
 * @toc: A #GstToc instance
 * @entry: (transfer full): A #GstTocEntry
 *
 * Appends the #GstTocEntry @entry to @toc.
 */
void
gst_toc_append_entry (GstToc * toc, GstTocEntry * entry)
{
  g_return_if_fail (toc != NULL);
  g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (toc)));
  g_return_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (entry)));
  g_return_if_fail (entry->toc == NULL);
  g_return_if_fail (entry->parent == NULL);

  toc->entries = g_list_append (toc->entries, entry);
  entry->toc = toc;

  GST_LOG ("appended %s entry with uid %s to toc %p",
      gst_toc_entry_type_get_nick (entry->type), entry->uid, toc);

  gst_toc_dump (toc);
}
开发者ID:Grobik1,项目名称:gstreamer,代码行数:24,代码来源:gsttoc.c

示例13: gst_subbuffer_finalize

static void
gst_subbuffer_finalize (GstSubBuffer * buffer)
{
  gst_buffer_unref (buffer->parent);

  GST_MINI_OBJECT_CLASS (sub_parent_class)->
      finalize (GST_MINI_OBJECT_CAST (buffer));
}
开发者ID:wosigh,项目名称:gstreamer,代码行数:8,代码来源:gstbuffer.c

示例14: gst_funnel_sink_chain

static GstFlowReturn
gst_funnel_sink_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
  GstFunnel *funnel = GST_FUNNEL (parent);

  return gst_funnel_sink_chain_object (pad, funnel, FALSE,
      GST_MINI_OBJECT_CAST (buffer));
}
开发者ID:Kurento,项目名称:gstreamer,代码行数:8,代码来源:gstfunnel.c

示例15: gst_rtsp_token_writable_structure

/**
 * gst_rtsp_token_writable_structure:
 * @token: The #GstRTSPToken.
 *
 * Get a writable version of the structure.
 *
 * Returns: (transfer none): The structure of the token. The structure is still
 * owned by the token, which means that you should not free it and that the
 * pointer becomes invalid when you free the token. This function checks if
 * @token is writable and will never return %NULL.
 *
 * MT safe.
 */
GstStructure *
gst_rtsp_token_writable_structure (GstRTSPToken * token)
{
  g_return_val_if_fail (GST_IS_RTSP_TOKEN (token), NULL);
  g_return_val_if_fail (gst_mini_object_is_writable (GST_MINI_OBJECT_CAST
          (token)), NULL);

  return GST_RTSP_TOKEN_STRUCTURE (token);
}
开发者ID:Lachann,项目名称:gst-rtsp-server,代码行数:22,代码来源:rtsp-token.c


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