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


C++ GST_MAKE_FOURCC函数代码示例

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


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

示例1: generate_sink_template

static GstCaps *
generate_sink_template (void)
{
    GstCaps *caps;
    GstStructure *struc;

    caps = gst_caps_new_empty ();

    struc = gst_structure_new ("video/x-raw-yuv",
                               "width", GST_TYPE_INT_RANGE, 16, 4096,
                               "height", GST_TYPE_INT_RANGE, 16, 4096,
                               "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 30, 1,
                               NULL);

    {
        GValue list = { 0 };
        GValue val = { 0 };

        g_value_init (&list, GST_TYPE_LIST);
        g_value_init (&val, GST_TYPE_FOURCC);

        gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('I', '4', '2', '0'));
        gst_value_list_append_value (&list, &val);

        gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'));
        gst_value_list_append_value (&list, &val);

        gst_value_set_fourcc (&val, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'));
        gst_value_list_append_value (&list, &val);

        gst_structure_set_value (struc, "format", &list);

        g_value_unset (&val);
        g_value_unset (&list);
    }

    gst_caps_append_structure (caps, struc);

    return caps;
}
开发者ID:FrederikVernelen,项目名称:gst-openmax,代码行数:40,代码来源:gstomx_videosink.c

示例2: gst_vtenc_base_init

static void
gst_vtenc_base_init (GstVTEncClass * klass)
{
  const GstVTEncoderDetails *codec_details =
      GST_VTENC_CLASS_GET_CODEC_DETAILS (klass);
  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
  const int min_width = 1, max_width = G_MAXINT;
  const int min_height = 1, max_height = G_MAXINT;
  const int min_fps_n = 0, max_fps_n = G_MAXINT;
  const int min_fps_d = 1, max_fps_d = 1;
  GstPadTemplate *sink_template, *src_template;
  GstCaps *src_caps;
  GstElementDetails details;

  details.longname = g_strdup_printf ("%s encoder", codec_details->name);
  details.klass = g_strdup_printf ("Codec/Encoder/Video");
  details.description = g_strdup_printf ("%s encoder", codec_details->name);

  gst_element_class_set_details_simple (element_class,
      details.longname, details.klass, details.description,
      "Ole André Vadla Ravnås <[email protected]>");

  g_free (details.longname);
  g_free (details.klass);
  g_free (details.description);

  sink_template = gst_pad_template_new ("sink",
      GST_PAD_SINK,
      GST_PAD_ALWAYS,
      gst_caps_new_simple ("video/x-raw-yuv",
          "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('N', 'V', '1', '2'),
          "width", GST_TYPE_INT_RANGE, min_width, max_width,
          "height", GST_TYPE_INT_RANGE, min_height, max_height,
          "framerate", GST_TYPE_FRACTION_RANGE,
          min_fps_n, min_fps_d, max_fps_n, max_fps_d, NULL));
  gst_element_class_add_pad_template (element_class, sink_template);
  gst_object_unref (sink_template);

  src_caps = gst_caps_new_simple (codec_details->mimetype,
      "width", GST_TYPE_INT_RANGE, min_width, max_width,
      "height", GST_TYPE_INT_RANGE, min_height, max_height,
      "framerate", GST_TYPE_FRACTION_RANGE,
      min_fps_n, min_fps_d, max_fps_n, max_fps_d, NULL);
  if (codec_details->format_id == kVTFormatH264) {
    gst_structure_set (gst_caps_get_structure (src_caps, 0),
        "stream-format", G_TYPE_STRING, "avc", NULL);
  }
  src_template = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
      src_caps);
  gst_element_class_add_pad_template (element_class, src_template);
  gst_object_unref (src_template);
}
开发者ID:dylansong77,项目名称:gstreamer,代码行数:52,代码来源:vtenc.c

示例3: generate_sink_template

static inline GstCaps *
generate_sink_template(void)
{
	GstCaps *caps;
	GstStructure *struc;

	caps = gst_caps_new_empty();

	struc = gst_structure_new("video/x-raw-yuv",
				  "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('U', 'Y', 'V', 'Y'),
				  NULL);

	gst_caps_append_structure(caps, struc);

	struc = gst_structure_new("video/x-raw-yuv",
				  "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC('I', '4', '2', '0'),
				  NULL);

	gst_caps_append_structure(caps, struc);

	return caps;
}
开发者ID:EQ4,项目名称:gst-dsp,代码行数:22,代码来源:gstdspvenc.c

示例4: gst_aiff_parse_parse_file_header

static gboolean
gst_aiff_parse_parse_file_header (GstAiffParse * aiff, GstBuffer * buf)
{
  guint8 *data;
  guint32 header, type = 0;

  if (GST_BUFFER_SIZE (buf) < 12) {
    GST_WARNING_OBJECT (aiff, "Buffer too short");
    goto not_aiff;
  }

  data = GST_BUFFER_DATA (buf);

  header = GST_READ_UINT32_LE (data);
  type = GST_READ_UINT32_LE (data + 8);

  if (header != GST_MAKE_FOURCC ('F', 'O', 'R', 'M'))
    goto not_aiff;

  if (type == GST_MAKE_FOURCC ('A', 'I', 'F', 'F'))
    aiff->is_aifc = FALSE;
  else if (type == GST_MAKE_FOURCC ('A', 'I', 'F', 'C'))
    aiff->is_aifc = TRUE;
  else
    goto not_aiff;

  gst_buffer_unref (buf);
  return TRUE;

  /* ERRORS */
not_aiff:
  {
    GST_ELEMENT_ERROR (aiff, STREAM, WRONG_TYPE, (NULL),
        ("File is not an AIFF file: %" GST_FOURCC_FORMAT,
            GST_FOURCC_ARGS (type)));
    gst_buffer_unref (buf);
    return FALSE;
  }
}
开发者ID:PeterXu,项目名称:gst-mobile,代码行数:39,代码来源:aiffparse.c

示例5: gst_ivf_parse_handle_frame_start

static GstFlowReturn
gst_ivf_parse_handle_frame_start (GstIvfParse * ivf, GstBaseParseFrame * frame,
    gint * skipsize)
{
  GstBuffer *const buffer = frame->buffer;
  GstMapInfo map;
  GstFlowReturn ret = GST_FLOW_OK;

  gst_buffer_map (buffer, &map, GST_MAP_READ);
  if (map.size >= IVF_FILE_HEADER_SIZE) {
    guint32 magic = GST_READ_UINT32_LE (map.data);
    guint16 version = GST_READ_UINT16_LE (map.data + 4);
    guint16 header_size = GST_READ_UINT16_LE (map.data + 6);
    guint32 fourcc = GST_READ_UINT32_LE (map.data + 8);
    guint16 width = GST_READ_UINT16_LE (map.data + 12);
    guint16 height = GST_READ_UINT16_LE (map.data + 14);
    guint32 fps_n = GST_READ_UINT32_LE (map.data + 16);
    guint32 fps_d = GST_READ_UINT32_LE (map.data + 20);
#ifndef GST_DISABLE_GST_DEBUG
    guint32 num_frames = GST_READ_UINT32_LE (map.data + 24);
#endif

    if (magic != GST_MAKE_FOURCC ('D', 'K', 'I', 'F') ||
        version != 0 || header_size != 32 ||
        fourcc_to_media_type (fourcc) == NULL) {
      GST_ELEMENT_ERROR (ivf, STREAM, WRONG_TYPE, (NULL), (NULL));
      ret = GST_FLOW_ERROR;
      goto end;
    }

    ivf->fourcc = fourcc;

    gst_ivf_parse_set_size (ivf, width, height);
    gst_ivf_parse_set_framerate (ivf, fps_n, fps_d);

    GST_LOG_OBJECT (ivf, "Stream has %d frames", num_frames);

    /* move along */
    ivf->state = GST_IVF_PARSE_DATA;
    gst_base_parse_set_min_frame_size (GST_BASE_PARSE_CAST (ivf),
        IVF_FRAME_HEADER_SIZE);
    *skipsize = IVF_FILE_HEADER_SIZE;
  } else {
    GST_LOG_OBJECT (ivf, "Header data not yet available.");
    *skipsize = 0;
  }

end:
  gst_buffer_unmap (buffer, &map);
  return ret;
}
开发者ID:0p1pp1,项目名称:gst-plugins-bad,代码行数:51,代码来源:gstivfparse.c

示例6: gst_tiprepencbuf_transform_caps

/******************************************************************************
 * gst_tiprepencbuf_transform_caps
 *   Most platforms require that the exact same caps are used on both ends.
 *   DM6467 can also convert from Y8C8/NV16 to NV12.
 *****************************************************************************/
static GstCaps*
gst_tiprepencbuf_transform_caps(GstBaseTransform * trans,
    GstPadDirection direction, GstCaps * caps)
{
    GstTIPrepEncBuf *prepencbuf = GST_TIPREPENCBUF(trans);
    GstCaps         *supported_caps;
    GstStructure    *caps_struct;

    g_return_val_if_fail(GST_IS_CAPS(caps), NULL);

    /* We always support the same caps on both sides */
    supported_caps = gst_caps_copy(caps);

    /* On DM6467, we also support conversion from Y8C8/NV16 to NV12 */
    if (prepencbuf->device == Cpu_Device_DM6467) {
        switch (direction) {
            case GST_PAD_SINK:
                caps_struct =
                    gst_structure_copy(gst_caps_get_structure(caps, 0));
                gst_structure_set(caps_struct, "format", GST_TYPE_FOURCC,
                    GST_MAKE_FOURCC('N', 'V', '1', '2'), (gchar *) NULL);
                gst_caps_append_structure(supported_caps, caps_struct);
                break;
            case GST_PAD_SRC:
                caps_struct =
                    gst_structure_copy(gst_caps_get_structure(caps, 0));
                gst_structure_set(caps_struct, "format", GST_TYPE_FOURCC,
                    GST_MAKE_FOURCC('N', 'V', '1', '6'), (gchar *) NULL);
                gst_caps_append_structure(supported_caps, caps_struct);
                break;
            case GST_PAD_UNKNOWN:
                break;
        }
    }

    return supported_caps;
}
开发者ID:xieran1988,项目名称:parents,代码行数:42,代码来源:gsttiprepencbuf.c

示例7: gst_mio_video_device_format_basics_to_structure

static GstStructure *
gst_mio_video_device_format_basics_to_structure (GstMIOVideoDevice * self,
    GstMIOVideoFormat * format)
{
  GstStructure *s;

  switch (format->type) {
    case kCVPixelFormatType_422YpCbCr8:
    case kCVPixelFormatType_422YpCbCr8Deprecated:
    {
      guint fcc;

      if (format->type == kCVPixelFormatType_422YpCbCr8)
        fcc = GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y');
      else
        fcc = GST_MAKE_FOURCC ('Y', 'U', 'Y', '2');

      s = gst_structure_new ("video/x-raw-yuv",
          "format", GST_TYPE_FOURCC, fcc,
          "width", G_TYPE_INT, format->dim.width,
          "height", G_TYPE_INT, format->dim.height, NULL);
      break;
    }
    case kFigVideoCodecType_JPEG_OpenDML:
    {
      s = gst_structure_new ("image/jpeg",
          "width", G_TYPE_INT, format->dim.width,
          "height", G_TYPE_INT, format->dim.height, NULL);
      break;
    }
    default:
      s = NULL;
      break;
  }

  return s;
}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-bad,代码行数:37,代码来源:miovideodevice.c

示例8: gst_sdlvideosink_base_init

static void
gst_sdlvideosink_base_init (gpointer g_class)
{
  GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
  GstCaps *capslist;
  gint i;
  guint32 formats[] = {
    GST_MAKE_FOURCC ('I', '4', '2', '0'),
    GST_MAKE_FOURCC ('Y', 'V', '1', '2'),
    GST_MAKE_FOURCC ('Y', 'U', 'Y', '2')
        /*
           GST_MAKE_FOURCC ('Y', 'V', 'Y', 'U'),
           GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y')
         */
  };

  /* make a list of all available caps */
  capslist = gst_caps_new_empty ();
  for (i = 0; i < G_N_ELEMENTS (formats); i++) {
    gst_caps_append_structure (capslist,
        gst_structure_new ("video/x-raw-yuv",
            "format", GST_TYPE_FOURCC, formats[i],
            "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
            "height", GST_TYPE_INT_RANGE, 1, G_MAXINT,
            "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL));
  }

  sink_template = gst_pad_template_new ("sink",
      GST_PAD_SINK, GST_PAD_ALWAYS, capslist);

  gst_element_class_add_pad_template (element_class, sink_template);
  gst_element_class_set_details_simple (element_class, "SDL video sink",
      "Sink/Video", "An SDL-based videosink",
      "Ronald Bultje <[email protected]>, "
      "Edgard Lima <[email protected]>, "
      "Jan Schmidt <[email protected]>");
}
开发者ID:jonasl,项目名称:gst-svtplayer,代码行数:37,代码来源:sdlvideosink.c

示例9: gst_decklink_mode_get_structure

static GstStructure *
gst_decklink_mode_get_structure (GstDecklinkModeEnum e)
{
  const GstDecklinkMode *mode = &modes[e];

  return gst_structure_new ("video/x-raw-yuv",
      "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'),
      "width", G_TYPE_INT, mode->width,
      "height", G_TYPE_INT, mode->height,
      "framerate", GST_TYPE_FRACTION, mode->fps_n, mode->fps_d,
      "interlaced", G_TYPE_BOOLEAN, mode->interlaced,
      "pixel-aspect-ratio", GST_TYPE_FRACTION, mode->par_n, mode->par_d,
      "color-matrix", G_TYPE_STRING, mode->is_hdtv ? "hdtv" : "sdtv",
      "chroma-site", G_TYPE_STRING, "mpeg2", NULL);
}
开发者ID:drothlis,项目名称:gst-plugins-bad,代码行数:15,代码来源:gstdecklink.cpp

示例10: gst_mim_enc_create_tcp_header

static void
gst_mim_enc_create_tcp_header (GstMimEnc * mimenc, guint8 * p,
    guint32 payload_size, GstClockTime ts, gboolean keyframe, gboolean paused)
{
  p[0] = 24;
  p[1] = paused ? 1 : 0;
  GST_WRITE_UINT16_LE (p + 2, mimenc->width);
  GST_WRITE_UINT16_LE (p + 4, mimenc->height);
  GST_WRITE_UINT16_LE (p + 6, keyframe ? 1 : 0);
  GST_WRITE_UINT32_LE (p + 8, payload_size);
  GST_WRITE_UINT32_LE (p + 12, paused ? 0 :
      GST_MAKE_FOURCC ('M', 'L', '2', '0'));
  GST_WRITE_UINT32_LE (p + 16, 0);
  GST_WRITE_UINT32_LE (p + 20, ts / GST_MSECOND);
}
开发者ID:collects,项目名称:gst-plugins-bad,代码行数:15,代码来源:gstmimenc.c

示例11: mxf_up_get_descriptor

static MXFMetadataFileDescriptor *
mxf_up_get_descriptor (GstPadTemplate * tmpl, GstCaps * caps,
    MXFEssenceElementWriteFunc * handler, gpointer * mapping_data)
{
  GstStructure *s;

  s = gst_caps_get_structure (caps, 0);
  if (strcmp (gst_structure_get_name (s), "video/x-raw-rgb") == 0) {
    return mxf_up_get_rgba_descriptor (tmpl, caps, handler, mapping_data);
  } else if (strcmp (gst_structure_get_name (s), "video/x-raw-yuv") == 0) {
    guint32 fourcc;

    if (!gst_structure_get_fourcc (s, "format", &fourcc))
      return NULL;

    if (fourcc == GST_MAKE_FOURCC ('A', 'Y', 'U', 'V') ||
        fourcc == GST_MAKE_FOURCC ('v', '3', '0', '8'))
      return mxf_up_get_rgba_descriptor (tmpl, caps, handler, mapping_data);

    return mxf_up_get_cdci_descriptor (tmpl, caps, handler, mapping_data);
  }

  g_assert_not_reached ();
}
开发者ID:bilboed,项目名称:gst-plugins-bad,代码行数:24,代码来源:mxfup.c

示例12: gst_vdp_video_buffer_calculate_size

gboolean
gst_vdp_video_buffer_calculate_size (guint32 fourcc, gint width, gint height,
    guint * size)
{
  switch (fourcc) {
    case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
    {
      *size = gst_video_format_get_size (GST_VIDEO_FORMAT_YV12, width, height);
      break;
    }
    case GST_MAKE_FOURCC ('I', '4', '2', '0'):
    {
      *size = gst_video_format_get_size (GST_VIDEO_FORMAT_YV12, width, height);
      break;
    }
    case GST_MAKE_FOURCC ('N', 'V', '1', '2'):
    {
      *size = width * height + width * height / 2;
      break;
    }
    case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
    {
      *size = gst_video_format_get_size (GST_VIDEO_FORMAT_UYVY, width, height);
      break;
    }
    case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
    {
      *size = gst_video_format_get_size (GST_VIDEO_FORMAT_YUY2, width, height);
      break;
    }
    default:
      return FALSE;
  }

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

示例13: tcam_gst_is_fourcc_rgb

bool tcam_gst_is_fourcc_rgb (const unsigned int fourcc)
{
    if (fourcc == GST_MAKE_FOURCC('R', 'G', 'B', 'x')
        || fourcc == GST_MAKE_FOURCC('x', 'R', 'G', 'B')
        || fourcc == GST_MAKE_FOURCC('B', 'G', 'R', 'x')
        || fourcc == GST_MAKE_FOURCC('x', 'B', 'G', 'R')
        || fourcc == GST_MAKE_FOURCC('R', 'G', 'B', 'A')
        || fourcc == GST_MAKE_FOURCC('A', 'R', 'G', 'B')
        || fourcc == GST_MAKE_FOURCC('B', 'G', 'R', 'A')
        || fourcc == GST_MAKE_FOURCC('A', 'B', 'G', 'R')
        || fourcc == FOURCC_BGR24
        || fourcc == FOURCC_RGB32
        || fourcc == FOURCC_RGB64)
    {
        return TRUE;
    }

    return FALSE;
}
开发者ID:TheImagingSource,项目名称:tiscamera,代码行数:19,代码来源:tcamgstbase.cpp

示例14: create_src_caps

static GstCaps * create_src_caps (GstOmxBaseFilter21 *omx_base)
{
    GstCaps *caps;    
    GstOmxBaseFilter21 *self;
    int width, height;
    GstStructure *struc;

    self = GST_OMX_BASE_FILTER21 (omx_base);
    caps = gst_pad_peer_get_caps (omx_base->srcpad);

    if (gst_caps_is_empty (caps))
    {

        width = 1920;
        height = 1088;

    }
    else
    {
        GstStructure *s;

        s = gst_caps_get_structure (caps, 0);

        if (!(gst_structure_get_int (s, "width", &width) &&
            gst_structure_get_int (s, "height", &height)))
        {

			width = 1920;
			height = 1088;

        }
    }

    caps = gst_caps_new_empty ();
    struc = gst_structure_new (("video/x-raw-yuv"),
            "width",  G_TYPE_INT, width,
            "height", G_TYPE_INT, height,
            "format", GST_TYPE_FOURCC, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
            NULL);


    gst_caps_append_structure (caps, struc);

    return caps;
}
开发者ID:skitlab,项目名称:gst-openmax-dm81xx,代码行数:45,代码来源:gstomx_videomixer_vodalys.c

示例15: transform_value

static void
transform_value (GValue * dest)
{
  GValue fourcc = { 0 };

  g_value_init (dest, GST_TYPE_LIST);
  g_value_init (&fourcc, GST_TYPE_FOURCC);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('I', '4', '2', '0'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('Y', 'V', '1', '2'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('Y', '4', '2', 'B'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('Y', '4', '4', '4'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('v', '2', '1', '0'));
  gst_value_list_append_value (dest, &fourcc);

  gst_value_set_fourcc (&fourcc, GST_MAKE_FOURCC ('v', '2', '1', '6'));
  gst_value_list_append_value (dest, &fourcc);

  g_value_unset (&fourcc);
}
开发者ID:kanongil,项目名称:gst-plugins-bad,代码行数:37,代码来源:gstcogcolorspace.c


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