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

C++ GST_V4L2_IS_OPEN函数代码示例

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

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



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

示例1: gst_v4l2_video_dec_open

static gboolean
gst_v4l2_video_dec_open (GstVideoDecoder * decoder)
{
  GstV4l2VideoDec *self = GST_V4L2_VIDEO_DEC (decoder);

  GST_DEBUG_OBJECT (self, "Opening");

  if (!gst_v4l2_object_open (self->v4l2output))
    goto failure;

  if (!gst_v4l2_object_open_shared (self->v4l2capture, self->v4l2output))
    goto failure;

  self->probed_sinkcaps = gst_v4l2_object_get_caps (self->v4l2output,
      gst_v4l2_object_get_codec_caps ());

  if (gst_caps_is_empty (self->probed_sinkcaps))
    goto no_encoded_format;

  self->probed_srccaps = gst_v4l2_object_get_caps (self->v4l2capture,
      gst_v4l2_object_get_raw_caps ());

  if (gst_caps_is_empty (self->probed_srccaps))
    goto no_raw_format;

  return TRUE;

no_encoded_format:
  GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
      (_("Encoder on device %s has no supported input format"),
          self->v4l2output->videodev), (NULL));
  goto failure;


no_raw_format:
  GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
      (_("Encoder on device %s has no supported output format"),
          self->v4l2output->videodev), (NULL));
  goto failure;

failure:
  if (GST_V4L2_IS_OPEN (self->v4l2output))
    gst_v4l2_object_close (self->v4l2output);

  if (GST_V4L2_IS_OPEN (self->v4l2capture))
    gst_v4l2_object_close (self->v4l2capture);

  gst_caps_replace (&self->probed_srccaps, NULL);
  gst_caps_replace (&self->probed_sinkcaps, NULL);

  return FALSE;
}
开发者ID:vatavuserban,项目名称:gst-plugins-good,代码行数:52,代码来源:gstv4l2videodec.c


示例2: gst_v4l2src_get_caps

static GstCaps *
gst_v4l2src_get_caps (GstBaseSrc * src)
{
  GstV4l2Src *v4l2src = GST_V4L2SRC (src);
  GstCaps *ret;
  GSList *walk;
  GSList *formats;

  if (!GST_V4L2_IS_OPEN (v4l2src->v4l2object)) {
    /* FIXME: copy? */
    return
        gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD
            (v4l2src)));
  }

  if (v4l2src->probed_caps)
    return gst_caps_ref (v4l2src->probed_caps);

  formats = gst_v4l2_object_get_format_list (v4l2src->v4l2object);

  ret = gst_caps_new_empty ();

  for (walk = formats; walk; walk = walk->next) {
    struct v4l2_fmtdesc *format;

    GstStructure *template;
开发者ID:Sandec,项目名称:openjfx-8u-dev-rt,代码行数:26,代码来源:gstv4l2src.c


示例3: gst_v4l2src_capture_stop

/******************************************************
 * gst_v4l2src_capture_stop():
 *   stop streaming capture
 * return value: TRUE on success, FALSE on error
 ******************************************************/
gboolean
gst_v4l2src_capture_stop (GstV4l2Src * v4l2src)
{
  GST_DEBUG_OBJECT (v4l2src, "stopping capturing");

  if (!GST_V4L2_IS_OPEN (v4l2src->v4l2object)) {
    goto done;
  }
  if (!GST_V4L2_IS_ACTIVE (v4l2src->v4l2object)) {
    goto done;
  }

  if (v4l2src->use_mmap) {
    /* we actually need to sync on all queued buffers but not
     * on the non-queued ones */
    if (!gst_v4l2_object_stop_streaming (v4l2src->v4l2object)) {
      return FALSE;
    }
  }

done:

  /* make an optional pending wait stop */
  v4l2src->quit = TRUE;
  v4l2src->is_capturing = FALSE;

  return TRUE;
}
开发者ID:rosciio,项目名称:gst-plugins-good,代码行数:33,代码来源:v4l2src_calls.c


示例4: gst_v4l2src_get_caps

static GstCaps *
gst_v4l2src_get_caps (GstBaseSrc * src, GstCaps * filter)
{
  GstV4l2Src *v4l2src;
  GstV4l2Object *obj;
  GstCaps *ret;
  GSList *walk;
  GSList *formats;

  v4l2src = GST_V4L2SRC (src);
  obj = v4l2src->v4l2object;

  if (!GST_V4L2_IS_OPEN (obj)) {
    return gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (v4l2src));
  }

  if (v4l2src->probed_caps)
    return gst_caps_ref (v4l2src->probed_caps);

  formats = gst_v4l2_object_get_format_list (obj);

  ret = gst_caps_new_empty ();

  for (walk = formats; walk; walk = walk->next) {
    struct v4l2_fmtdesc *format;
    GstStructure *template;
开发者ID:collects,项目名称:gst-plugins-good,代码行数:26,代码来源:gstv4l2src.c


示例5: gst_v4l2sink_sync_overlay_fields

static void
gst_v4l2sink_sync_overlay_fields (GstV4l2Sink * v4l2sink)
{
  if (GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {

    gint fd = v4l2sink->v4l2object->video_fd;
    struct v4l2_format format;

    memset (&format, 0x00, sizeof (struct v4l2_format));
    format.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;

    g_return_if_fail (v4l2_ioctl (fd, VIDIOC_G_FMT, &format) >= 0);

    if (v4l2sink->overlay_fields_set) {
      if (v4l2sink->overlay_fields_set & OVERLAY_TOP_SET)
        format.fmt.win.w.top = v4l2sink->overlay.top;
      if (v4l2sink->overlay_fields_set & OVERLAY_LEFT_SET)
        format.fmt.win.w.left = v4l2sink->overlay.left;
      if (v4l2sink->overlay_fields_set & OVERLAY_WIDTH_SET)
        format.fmt.win.w.width = v4l2sink->overlay.width;
      if (v4l2sink->overlay_fields_set & OVERLAY_HEIGHT_SET)
        format.fmt.win.w.height = v4l2sink->overlay.height;

      g_return_if_fail (v4l2_ioctl (fd, VIDIOC_S_FMT, &format) >= 0);
      v4l2sink->overlay_fields_set = 0;
    }

    v4l2sink->overlay = format.fmt.win.w;
  }
}
开发者ID:cookie114,项目名称:PerforceRoot_Lupc,代码行数:30,代码来源:gstv4l2sink.c


示例6: gst_v4l2_tuner_set_frequency

gboolean
gst_v4l2_tuner_set_frequency (GstV4l2Object * v4l2object,
    GstTunerChannel * channel, gulong frequency)
{
  GstV4l2TunerChannel *v4l2channel = GST_V4L2_TUNER_CHANNEL (channel);
  gint chan;

  /* assert that we're opened and that we're using a known item */
  g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2object), FALSE);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), FALSE);
  g_return_val_if_fail (gst_v4l2_tuner_contains_channel (v4l2object,
          v4l2channel), FALSE);

  if (v4l2object->get_in_out_func (v4l2object, &chan)) {
    if (chan == GST_V4L2_TUNER_CHANNEL (channel)->index &&
        GST_TUNER_CHANNEL_HAS_FLAG (channel, GST_TUNER_CHANNEL_FREQUENCY)) {
      if (gst_v4l2_set_frequency (v4l2object, v4l2channel->tuner, frequency)) {
        gst_tuner_frequency_changed (GST_TUNER (v4l2object->element), channel,
            frequency);
        return TRUE;
      }
    }
  }

  return FALSE;
}
开发者ID:TheBigW,项目名称:gst-plugins-good,代码行数:27,代码来源:gstv4l2tuner.c


示例7: gst_v4l2_get_input

gboolean
gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input)
{
  gint n;

  GST_DEBUG_OBJECT (v4l2object->element, "trying to get input");

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_INPUT, &n) < 0)
    goto input_failed;

  *input = n;

  GST_DEBUG_OBJECT (v4l2object->element, "input: %d", n);

  return TRUE;

  /* ERRORS */
input_failed:
  {
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to get current input on device '%s'. May be it is a radio device"), v4l2object->videodev), GST_ERROR_SYSTEM);
    return FALSE;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:27,代码来源:v4l2_calls.c


示例8: gst_v4l2sink_get_caps

static GstCaps *
gst_v4l2sink_get_caps (GstBaseSink * bsink)
{
  GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink);
  GstCaps *ret;
  GSList *walk;
  GSList *formats;

  if (!GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {
    /* FIXME: copy? */
    GST_DEBUG_OBJECT (v4l2sink, "device is not open");
    return
        gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SINK_PAD
            (v4l2sink)));
  }

  if (v4l2sink->probed_caps) {
    LOG_CAPS (v4l2sink, v4l2sink->probed_caps);
    return gst_caps_ref (v4l2sink->probed_caps);
  }

  formats = gst_v4l2_object_get_format_list (v4l2sink->v4l2object);

  ret = gst_caps_new_empty ();

  for (walk = v4l2sink->v4l2object->formats; walk; walk = walk->next) {
    struct v4l2_fmtdesc *format;

    GstStructure *template;
开发者ID:cookie114,项目名称:PerforceRoot_Lupc,代码行数:29,代码来源:gstv4l2sink.c


示例9: gst_v4l2_signal_strength

/******************************************************
 * gst_v4l2_signal_strength():
 *   get the strength of the signal on the current input
 * return value: TRUE on success, FALSE on error
 ******************************************************/
gboolean
gst_v4l2_signal_strength (GstV4l2Object * v4l2object,
    gint tunernum, gulong * signal_strength)
{
  struct v4l2_tuner tuner = { 0, };

  GST_DEBUG_OBJECT (v4l2object->element, "trying to get signal strength");

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  tuner.index = tunernum;
  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &tuner) < 0)
    goto tuner_failed;

  *signal_strength = tuner.signal;

  return TRUE;

  /* ERRORS */
tuner_failed:
  {
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to get signal strength for device '%s'."),
            v4l2object->videodev), GST_ERROR_SYSTEM);
    return FALSE;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:33,代码来源:v4l2_calls.c


示例10: gst_v4l2_set_attribute

/******************************************************
 * gst_v4l2_set_attribute():
 *   try to set the value of one specific attribute
 * return value: TRUE on success, FALSE on error
 ******************************************************/
gboolean
gst_v4l2_set_attribute (GstV4l2Object * v4l2object,
    int attribute_num, const int value)
{
  struct v4l2_control control = { 0, };

  GST_DEBUG_OBJECT (v4l2object->element, "setting value of attribute %d to %d",
      attribute_num, value);

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  control.id = attribute_num;
  control.value = value;
  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_CTRL, &control) < 0)
    goto ctrl_failed;

  return TRUE;

  /* ERRORS */
ctrl_failed:
  {
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to set value %d for control %d on device '%s'."),
            value, attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM);
    return FALSE;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:33,代码来源:v4l2_calls.c


示例11: gst_v4l2_get_capabilities

/******************************************************
 * gst_v4l2_get_capabilities():
 *   get the device's capturing capabilities
 * return value: TRUE on success, FALSE on error
 ******************************************************/
gboolean
gst_v4l2_get_capabilities (GstV4l2Object * v4l2object)
{
  GstElement *e;

  e = v4l2object->element;

  GST_DEBUG_OBJECT (e, "getting capabilities");

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCAP, &v4l2object->vcap) < 0)
    goto cap_failed;

  GST_LOG_OBJECT (e, "driver:      '%s'", v4l2object->vcap.driver);
  GST_LOG_OBJECT (e, "card:        '%s'", v4l2object->vcap.card);
  GST_LOG_OBJECT (e, "bus_info:    '%s'", v4l2object->vcap.bus_info);
  GST_LOG_OBJECT (e, "version:     %08x", v4l2object->vcap.version);
  GST_LOG_OBJECT (e, "capabilites: %08x", v4l2object->vcap.capabilities);

  return TRUE;

  /* ERRORS */
cap_failed:
  {
    GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS,
        (_("Error getting capabilities for device '%s': "
                "It isn't a v4l2 driver. Check if it is a v4l1 driver."),
            v4l2object->videodev), GST_ERROR_SYSTEM);
    return FALSE;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:38,代码来源:v4l2_calls.c


示例12: gst_v4l2_set_frequency

/******************************************************
 * gst_v4l2_set_frequency():
 *   set frequency
 * return value: TRUE on success, FALSE on error
 ******************************************************/
gboolean
gst_v4l2_set_frequency (GstV4l2Object * v4l2object,
    gint tunernum, gulong frequency)
{
  struct v4l2_frequency freq = { 0, };

  GstTunerChannel *channel;

  GST_DEBUG_OBJECT (v4l2object->element,
      "setting current tuner frequency to %lu", frequency);

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  channel = gst_tuner_get_channel (GST_TUNER (v4l2object->element));

  freq.tuner = tunernum;
  /* fill in type - ignore error */
  v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_FREQUENCY, &freq);
  freq.frequency = frequency / channel->freq_multiplicator;

  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_FREQUENCY, &freq) < 0)
    goto freq_failed;

  return TRUE;

  /* ERRORS */
freq_failed:
  {
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to set current tuner frequency for device '%s' to %lu Hz."),
            v4l2object->videodev, frequency), GST_ERROR_SYSTEM);
    return FALSE;
  }
}
开发者ID:zsx,项目名称:ossbuild,代码行数:40,代码来源:v4l2_calls.c


示例13: gst_v4l2_set_output

gboolean
gst_v4l2_set_output (GstV4l2Object * v4l2object, gint output)
{
  GST_DEBUG_OBJECT (v4l2object->element, "trying to set output to %d", output);

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_OUTPUT, &output) < 0)
    goto output_failed;

  return TRUE;

  /* ERRORS */
output_failed:
  if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) {
    /* only give a warning message if driver actually claims to have tuner
     * support
     */
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to set output %d on device %s."),
            output, v4l2object->videodev), GST_ERROR_SYSTEM);
  }
  return FALSE;
}
开发者ID:BigBrother-International,项目名称:gst-plugins-good,代码行数:25,代码来源:v4l2_calls.c


示例14: gst_v4l2_get_output

gboolean
gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output)
{
  gint n;

  GST_DEBUG_OBJECT (v4l2object->element, "trying to get output");

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_OUTPUT, &n) < 0)
    goto output_failed;

  *output = n;

  GST_DEBUG_OBJECT (v4l2object->element, "output: %d", n);

  return TRUE;

  /* ERRORS */
output_failed:
  if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) {
    /* only give a warning message if driver actually claims to have tuner
     * support
     */
    GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS,
        (_("Failed to get current output on device '%s'. May be it is a radio device"), v4l2object->videodev), GST_ERROR_SYSTEM);
  }
  return FALSE;
}
开发者ID:BigBrother-International,项目名称:gst-plugins-good,代码行数:30,代码来源:v4l2_calls.c


示例15: gst_v4l2_decoder_cmd

static gboolean
gst_v4l2_decoder_cmd (GstV4l2Object * v4l2object, guint cmd, guint flags)
{
  struct v4l2_decoder_cmd dcmd = { 0, };

  GST_DEBUG_OBJECT (v4l2object->element,
      "sending v4l2 decoder command %u with flags %u", cmd, flags);

  if (!GST_V4L2_IS_OPEN (v4l2object))
    return FALSE;

  dcmd.cmd = cmd;
  dcmd.flags = flags;
  if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_DECODER_CMD, &dcmd) < 0)
    goto dcmd_failed;

  return TRUE;

dcmd_failed:
  if (errno == ENOTTY) {
    GST_INFO_OBJECT (v4l2object->element,
        "Failed to send decoder command %u with flags %u for '%s'. (%s)",
        cmd, flags, v4l2object->videodev, g_strerror (errno));
  } else {
    GST_ERROR_OBJECT (v4l2object->element,
        "Failed to send decoder command %u with flags %u for '%s'. (%s)",
        cmd, flags, v4l2object->videodev, g_strerror (errno));
  }
  return FALSE;
}
开发者ID:Kurento,项目名称:gst-plugins-good,代码行数:30,代码来源:gstv4l2videodec.c


示例16: gst_v4l2_xoverlay_prepare_xwindow_id

/**
 * gst_v4l2_xoverlay_prepare_xwindow_id:
 * @v4l2object: the v4l2object
 * @required: %TRUE if display is required (ie. TRUE for v4l2sink, but
 *   FALSE for any other element with optional overlay capabilities)
 *
 * Helper function to create a windo if none is set from the application.
 */
void
gst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object,
    gboolean required)
{
  if (!GST_V4L2_IS_OVERLAY (v4l2object))
    return;

  gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (v4l2object->element));

  if (required && !v4l2object->xwindow_id) {
    GstV4l2Xv *v4l2xv;
    Window win;
    int width, height;
    long event_mask;

    if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))
      gst_v4l2_xoverlay_open (v4l2object);

    v4l2xv = v4l2object->xv;

    /* if xoverlay is not supported, just bail */
    if (!v4l2xv)
      return;

    /* xoverlay is supported, but we don't have a window.. so create one */
    GST_DEBUG_OBJECT (v4l2object->element, "creating window");

    g_mutex_lock (v4l2xv->mutex);

    width = XDisplayWidth (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));
    height = XDisplayHeight (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));
    GST_DEBUG_OBJECT (v4l2object->element, "dpy=%p", v4l2xv->dpy);

    win = XCreateSimpleWindow (v4l2xv->dpy,
        DefaultRootWindow (v4l2xv->dpy),
        0, 0, width, height, 0, 0,
        XBlackPixel (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy)));

    GST_DEBUG_OBJECT (v4l2object->element, "win=%lu", win);

    event_mask = ExposureMask | StructureNotifyMask;
    if (GST_IS_NAVIGATION (v4l2object->element)) {
      event_mask |= PointerMotionMask |
          KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
    }
    XSelectInput (v4l2xv->dpy, win, event_mask);
    v4l2xv->event_id = g_timeout_add (45, event_refresh, v4l2object);

    XMapRaised (v4l2xv->dpy, win);

    XSync (v4l2xv->dpy, FALSE);

    g_mutex_unlock (v4l2xv->mutex);

    GST_DEBUG_OBJECT (v4l2object->element, "got window");

    gst_v4l2_xoverlay_set_window_handle (v4l2object, win);
  }
}
开发者ID:matsu,项目名称:gst-plugins-good,代码行数:67,代码来源:gstv4l2xoverlay.c


示例17: gst_v4l2sink_set_caps

static gboolean
gst_v4l2sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
{
  GstV4l2Sink *v4l2sink = GST_V4L2SINK (bsink);
  GstV4l2Object *obj = v4l2sink->v4l2object;

  LOG_CAPS (v4l2sink, caps);

  if (!GST_V4L2_IS_OPEN (v4l2sink->v4l2object)) {
    GST_DEBUG_OBJECT (v4l2sink, "device is not open");
    return FALSE;
  }

  /* make sure the caps changed before doing anything */
  if (gst_v4l2_object_caps_equal (obj, caps))
    return TRUE;

  if (!gst_v4l2_object_stop (obj))
    goto stop_failed;

  if (!gst_v4l2_object_set_format (v4l2sink->v4l2object, caps))
    goto invalid_format;

  gst_v4l2sink_sync_overlay_fields (v4l2sink);
  gst_v4l2sink_sync_crop_fields (v4l2sink);

#ifdef HAVE_XVIDEO
  gst_v4l2_video_overlay_prepare_window_handle (v4l2sink->v4l2object, TRUE);
#endif

  GST_INFO_OBJECT (v4l2sink, "outputting buffers via mmap()");

  v4l2sink->video_width = GST_V4L2_WIDTH (v4l2sink->v4l2object);
  v4l2sink->video_height = GST_V4L2_HEIGHT (v4l2sink->v4l2object);

  /* TODO: videosink width/height should be scaled according to
   * pixel-aspect-ratio
   */
  GST_VIDEO_SINK_WIDTH (v4l2sink) = v4l2sink->video_width;
  GST_VIDEO_SINK_HEIGHT (v4l2sink) = v4l2sink->video_height;

  return TRUE;

  /* ERRORS */
stop_failed:
  {
    GST_DEBUG_OBJECT (v4l2sink, "failed to stop streaming");
    return FALSE;
  }
invalid_format:
  {
    /* error already posted */
    GST_DEBUG_OBJECT (v4l2sink, "can't set format");
    return FALSE;
  }
}
开发者ID:PeterXu,项目名称:gst-mobile,代码行数:56,代码来源:gstv4l2sink.c


示例18: gst_v4l2_xoverlay_set_xwindow_id

void
gst_v4l2_xoverlay_set_xwindow_id (GstV4l2Object * v4l2object, XID xwindow_id)
{
    GstV4l2Xv *v4l2xv;
    XWindowAttributes attr;
    gboolean change = (v4l2object->xwindow_id != xwindow_id);

    GST_LOG_OBJECT (v4l2object->element, "Setting XID to %lx",
                    (gulong) xwindow_id);

    if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))
        gst_v4l2_xoverlay_open (v4l2object);

    v4l2xv = v4l2object->xv;

    if (v4l2xv)
        g_mutex_lock (v4l2xv->mutex);

    if (change) {
        if (v4l2object->xwindow_id && v4l2xv) {
            GST_DEBUG_OBJECT (v4l2object->element,
                              "Deactivating old port %lx", v4l2object->xwindow_id);

            XvSelectPortNotify (v4l2xv->dpy, v4l2xv->port, 0);
            XvSelectVideoNotify (v4l2xv->dpy, v4l2object->xwindow_id, 0);
            XvStopVideo (v4l2xv->dpy, v4l2xv->port, v4l2object->xwindow_id);
        }

        v4l2object->xwindow_id = xwindow_id;
    }

    if (!v4l2xv || xwindow_id == 0) {
        if (v4l2xv)
            g_mutex_unlock (v4l2xv->mutex);
        return;
    }

    if (change) {
        GST_DEBUG_OBJECT (v4l2object->element, "Activating new port %lx",
                          xwindow_id);

        /* draw */
        XvSelectPortNotify (v4l2xv->dpy, v4l2xv->port, 1);
        XvSelectVideoNotify (v4l2xv->dpy, v4l2object->xwindow_id, 1);
    }

    XGetWindowAttributes (v4l2xv->dpy, v4l2object->xwindow_id, &attr);
    XvPutVideo (v4l2xv->dpy, v4l2xv->port, v4l2object->xwindow_id,
                DefaultGC (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy)),
                0, 0, attr.width, attr.height, 0, 0, attr.width, attr.height);

    if (v4l2xv->idle_id)
        g_source_remove (v4l2xv->idle_id);
    v4l2xv->idle_id = g_idle_add (idle_refresh, v4l2object);
    g_mutex_unlock (v4l2xv->mutex);
}
开发者ID:prajnashi,项目名称:gst-plugins-good,代码行数:56,代码来源:gstv4l2xoverlay.c


示例19: gst_v4l2_tuner_get_norm

GstTunerNorm *
gst_v4l2_tuner_get_norm (GstV4l2Object * v4l2object)
{
  v4l2_std_id norm;

  /* assert that we're opened and that we're using a known item */
  g_return_val_if_fail (GST_V4L2_IS_OPEN (v4l2object), NULL);

  gst_v4l2_get_norm (v4l2object, &norm);

  return gst_v4l2_tuner_get_norm_by_std_id (v4l2object, norm);
}
开发者ID:TheBigW,项目名称:gst-plugins-good,代码行数:12,代码来源:gstv4l2tuner.c


示例20: gst_v4l2_xoverlay_set_window_handle

void
gst_v4l2_xoverlay_set_window_handle (GstV4l2Object * v4l2object, guintptr id)
{
  GstV4l2Xv *v4l2xv;
  XID xwindow_id = id;
  gboolean change = (v4l2object->xwindow_id != xwindow_id);

  GST_LOG_OBJECT (v4l2object->element, "Setting XID to %lx",
      (gulong) xwindow_id);

  if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))
    gst_v4l2_xoverlay_open (v4l2object);

  v4l2xv = v4l2object->xv;

  if (v4l2xv)
    g_mutex_lock (v4l2xv->mutex);

  if (change) {
    if (v4l2object->xwindow_id && v4l2xv) {
      GST_DEBUG_OBJECT (v4l2object->element,
          "Deactivating old port %lx", v4l2object->xwindow_id);

      XvSelectPortNotify (v4l2xv->dpy, v4l2xv->port, 0);
      XvSelectVideoNotify (v4l2xv->dpy, v4l2object->xwindow_id, 0);
      XvStopVideo (v4l2xv->dpy, v4l2xv->port, v4l2object->xwindow_id);
    }

    v4l2object->xwindow_id = xwindow_id;
  }

  if (!v4l2xv || xwindow_id == 0) {
    if (v4l2xv)
      g_mutex_unlock (v4l2xv->mutex);
    return;
  }

  if (change) {
    GST_DEBUG_OBJECT (v4l2object->element, "Activating new port %lx",
        xwindow_id);

    /* draw */
    XvSelectPortNotify (v4l2xv->dpy, v4l2xv->port, 1);
    XvSelectVideoNotify (v4l2xv->dpy, v4l2object->xwindow_id, 1);
  }

  update_geometry (v4l2object);

  if (v4l2xv->idle_id)
    g_source_remove (v4l2xv->idle_id);
  v4l2xv->idle_id = g_idle_add (idle_refresh, v4l2object);
  g_mutex_unlock (v4l2xv->mutex);
}
开发者ID:matsu,项目名称:gst-plugins-good,代码行数:53,代码来源:gstv4l2xoverlay.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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