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


C++ GST_DECKLINK_SRC函数代码示例

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


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

示例1: gst_decklink_src_stop

static gboolean
gst_decklink_src_stop (GstElement * element)
{
  GstDecklinkSrc *decklinksrc = GST_DECKLINK_SRC (element);

  gst_task_stop (decklinksrc->task);

  g_mutex_lock (&decklinksrc->mutex);
  decklinksrc->stop = TRUE;
  g_cond_signal (&decklinksrc->cond);
  g_mutex_unlock (&decklinksrc->mutex);

  gst_task_join (decklinksrc->task);

  decklinksrc->input->StopStreams ();
  decklinksrc->input->DisableVideoInput ();
  decklinksrc->input->DisableAudioInput ();

  g_list_free_full (decklinksrc->pending_events,
      (GDestroyNotify) gst_mini_object_unref);
  decklinksrc->pending_events = NULL;
  decklinksrc->have_events = FALSE;
  decklinksrc->pending_eos = FALSE;

  return TRUE;
}
开发者ID:iainlane,项目名称:gstreamer,代码行数:26,代码来源:gstdecklinksrc.cpp

示例2: gst_decklink_src_finalize

void
gst_decklink_src_finalize (GObject * object)
{
  GstDecklinkSrc *decklinksrc;

  g_return_if_fail (GST_IS_DECKLINK_SRC (object));
  decklinksrc = GST_DECKLINK_SRC (object);

  /* clean up object here */

  g_cond_clear (&decklinksrc->cond);
  g_mutex_clear (&decklinksrc->mutex);
  gst_task_set_lock (decklinksrc->task, NULL);
  g_object_unref (decklinksrc->task);

#ifdef _MSC_VER
  /* signal the COM thread that it should uninitialize COM */
  if (decklinksrc->comInitialized) {
    g_mutex_lock (&decklinksrc->com_deinit_lock);
    g_cond_signal (&decklinksrc->com_uninitialize);
    g_cond_wait (&decklinksrc->com_uninitialized, &decklinksrc->com_deinit_lock);
    g_mutex_unlock (&decklinksrc->com_deinit_lock);
  }

  g_mutex_clear (&decklinksrc->com_init_lock);
  g_mutex_clear (&decklinksrc->com_deinit_lock);
  g_cond_clear (&decklinksrc->com_initialized);
  g_cond_clear (&decklinksrc->com_uninitialize);
  g_cond_clear (&decklinksrc->com_uninitialized);
#endif /* _MSC_VER */

  g_rec_mutex_clear (&decklinksrc->task_mutex);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:35,代码来源:gstdecklinksrc.cpp

示例3: gst_decklink_src_stop

static gboolean
gst_decklink_src_stop (GstElement * element)
{
  GstDecklinkSrc *decklinksrc = GST_DECKLINK_SRC (element);

  gst_task_stop (decklinksrc->task);

  g_mutex_lock (decklinksrc->mutex);
  decklinksrc->stop = TRUE;
  g_cond_signal (decklinksrc->cond);
  g_mutex_unlock (decklinksrc->mutex);

  gst_task_join (decklinksrc->task);

  decklinksrc->input->StopStreams ();
  decklinksrc->input->DisableVideoInput ();
  decklinksrc->input->DisableAudioInput ();

  decklinksrc->input->Release ();
  decklinksrc->input = NULL;

  decklinksrc->decklink->Release ();
  decklinksrc->decklink = NULL;

  return TRUE;
}
开发者ID:drothlis,项目名称:gst-plugins-bad,代码行数:26,代码来源:gstdecklinksrc.cpp

示例4: gst_decklink_src_get_property

void
gst_decklink_src_get_property (GObject * object, guint property_id,
                               GValue * value, GParamSpec * pspec)
{
    GstDecklinkSrc *decklinksrc;

    g_return_if_fail (GST_IS_DECKLINK_SRC (object));
    decklinksrc = GST_DECKLINK_SRC (object);

    switch (property_id) {
    case PROP_MODE:
        g_value_set_enum (value, decklinksrc->mode);
        break;
    case PROP_CONNECTION:
        g_value_set_enum (value, decklinksrc->connection);
        break;
    case PROP_AUDIO_INPUT:
        g_value_set_enum (value, decklinksrc->audio_connection);
        break;
    case PROP_SUBDEVICE:
        g_value_set_int (value, decklinksrc->subdevice);
        break;
    default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
        break;
    }
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:27,代码来源:gstdecklinksrc.cpp

示例5: gst_decklink_src_set_property

void
gst_decklink_src_set_property (GObject * object, guint property_id,
    const GValue * value, GParamSpec * pspec)
{
  GstDecklinkSrc *decklinksrc;

  decklinksrc = GST_DECKLINK_SRC (object);

  switch (property_id) {
    case PROP_MODE:
      decklinksrc->mode = (GstDecklinkModeEnum) g_value_get_enum (value);
      break;
    case PROP_CONNECTION:
      decklinksrc->connection =
          (GstDecklinkConnectionEnum) g_value_get_enum (value);
      break;
    case PROP_AUDIO_INPUT:
      decklinksrc->audio_connection =
          (GstDecklinkAudioConnectionEnum) g_value_get_enum (value);
      break;
    case PROP_DEVICE:
      decklinksrc->device = g_value_get_int (value);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
      break;
  }
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:28,代码来源:gstdecklinksrc.cpp

示例6: gst_decklink_src_audio_src_fixatecaps

static void
gst_decklink_src_audio_src_fixatecaps (GstPad * pad, GstCaps * caps)
{
    GstDecklinkSrc *decklinksrc;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "fixatecaps");


    gst_object_unref (decklinksrc);
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:12,代码来源:gstdecklinksrc.cpp

示例7: gst_decklink_src_audio_src_activatepull

static gboolean
gst_decklink_src_audio_src_activatepull (GstPad * pad, gboolean active)
{
  GstDecklinkSrc *decklinksrc;

  decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

  GST_DEBUG_OBJECT (decklinksrc, "activatepull");

  gst_object_unref (decklinksrc);
  return FALSE;
}
开发者ID:drothlis,项目名称:gst-plugins-bad,代码行数:12,代码来源:gstdecklinksrc.cpp

示例8: g_return_val_if_fail

HRESULT
    DeckLinkCaptureDelegate::VideoInputFrameArrived (IDeckLinkVideoInputFrame *
    videoFrame, IDeckLinkAudioInputPacket * audioFrame)
{
  GstDecklinkSrc *decklinksrc;

  g_return_val_if_fail (priv != NULL, S_OK);
  g_return_val_if_fail (GST_IS_DECKLINK_SRC (priv), S_OK);

  decklinksrc = GST_DECKLINK_SRC (priv);

  // Handle Video Frame
  if (videoFrame) {
    if (videoFrame->GetFlags () & bmdFrameHasNoInputSource) {
      GST_DEBUG ("Frame received - No input signal detected");
    } else {
      const char *timecodeString = NULL;
      if (g_timecodeFormat != 0) {
        IDeckLinkTimecode *timecode;
        if (videoFrame->GetTimecode (g_timecodeFormat, &timecode) == S_OK) {
          timecode->GetString (&timecodeString);
          CONVERT_COM_STRING (timecodeString);
        }
      }

      GST_DEBUG ("Frame received [%s] - %s - Size: %li bytes",
          timecodeString != NULL ? timecodeString : "No timecode",
          "Valid Frame", videoFrame->GetRowBytes () * videoFrame->GetHeight ());

      if (timecodeString)
        FREE_COM_STRING (timecodeString);

      g_mutex_lock (decklinksrc->mutex);
      if (decklinksrc->video_frame != NULL) {
        decklinksrc->dropped_frames++;
      } else {
        videoFrame->AddRef ();
        decklinksrc->video_frame = videoFrame;
        if (audioFrame) {
          audioFrame->AddRef ();
          decklinksrc->audio_frame = audioFrame;
        }
      }

      /* increment regardless whether frame was dropped or not */
      decklinksrc->frame_num++;

      g_cond_signal (decklinksrc->cond);
      g_mutex_unlock (decklinksrc->mutex);
    }
  }
  return S_OK;
}
开发者ID:dylansong77,项目名称:gstreamer,代码行数:53,代码来源:capture.cpp

示例9: gst_decklink_src_send_event

/* events sent to this element directly, mainly from the application */
static gboolean
gst_decklink_src_send_event (GstElement * element, GstEvent * event)
{
  GstDecklinkSrc *src;
  gboolean result = FALSE;

  src = GST_DECKLINK_SRC (element);

  GST_DEBUG_OBJECT (src, "handling event %p %" GST_PTR_FORMAT, event, event);

  switch (GST_EVENT_TYPE (event)) {
    case GST_EVENT_EOS:
      g_atomic_int_set (&src->pending_eos, TRUE);
      GST_INFO_OBJECT (src, "EOS pending");
      result = TRUE;
      break;
      break;
    case GST_EVENT_TAG:
    case GST_EVENT_CUSTOM_DOWNSTREAM:
    case GST_EVENT_CUSTOM_BOTH:
      /* Insert TAG, CUSTOM_DOWNSTREAM, CUSTOM_BOTH in the dataflow */
      GST_OBJECT_LOCK (src);
      src->pending_events = g_list_append (src->pending_events, event);
      g_atomic_int_set (&src->have_events, TRUE);
      GST_OBJECT_UNLOCK (src);
      event = NULL;
      result = TRUE;
      break;
    case GST_EVENT_CUSTOM_DOWNSTREAM_OOB:
    case GST_EVENT_CUSTOM_BOTH_OOB:
      /* insert a random custom event into the pipeline */
      GST_DEBUG_OBJECT (src, "pushing custom OOB event downstream");
      result = gst_pad_push_event (src->videosrcpad, gst_event_ref (event));
      result |= gst_pad_push_event (src->audiosrcpad, event);
      /* we gave away the ref to the event in the push */
      event = NULL;
      break;
    case GST_EVENT_CUSTOM_UPSTREAM:
      /* drop */
    case GST_EVENT_SEGMENT:
      /* sending random SEGMENT downstream can break sync - drop */
    default:
      GST_LOG_OBJECT (src, "dropping %s event", GST_EVENT_TYPE_NAME (event));
      break;
  }

  /* if we still have a ref to the event, unref it now */
  if (event)
    gst_event_unref (event);

  return result;
}
开发者ID:iainlane,项目名称:gstreamer,代码行数:53,代码来源:gstdecklinksrc.cpp

示例10: gst_decklink_src_video_src_acceptcaps

static gboolean
gst_decklink_src_video_src_acceptcaps (GstPad * pad, GstCaps * caps)
{
    GstDecklinkSrc *decklinksrc;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "acceptcaps");


    gst_object_unref (decklinksrc);
    return TRUE;
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:13,代码来源:gstdecklinksrc.cpp

示例11: gst_decklink_src_audio_src_link

static GstPadLinkReturn
gst_decklink_src_audio_src_link (GstPad * pad, GstPad * peer)
{
    GstDecklinkSrc *decklinksrc;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "link");


    gst_object_unref (decklinksrc);
    return GST_PAD_LINK_OK;
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:13,代码来源:gstdecklinksrc.cpp

示例12: gst_decklink_src_video_src_query

static gboolean
gst_decklink_src_video_src_query (GstPad * pad, GstObject * parent,
    GstQuery * query)
{
  GstDecklinkSrc *decklinksrc;
  gboolean ret = FALSE;

  decklinksrc = GST_DECKLINK_SRC (parent);

  GST_DEBUG_OBJECT (pad, "query: %" GST_PTR_FORMAT, query);

  switch (GST_QUERY_TYPE (query)) {
    case GST_QUERY_LATENCY:{
      GstClockTime min_latency, max_latency;
      const GstDecklinkMode *mode;

      /* device must be open */
      if (decklinksrc->decklink == NULL) {
        GST_WARNING_OBJECT (decklinksrc,
            "Can't give latency since device isn't open !");
        goto done;
      }

      mode = gst_decklink_get_mode (decklinksrc->mode);

      /* min latency is the time to capture one frame */
      min_latency =
          gst_util_uint64_scale_int (GST_SECOND, mode->fps_d, mode->fps_n);

      /* max latency is total duration of the frame buffer */
      max_latency = 2 * min_latency;

      GST_DEBUG_OBJECT (decklinksrc,
          "report latency min %" GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
          GST_TIME_ARGS (min_latency), GST_TIME_ARGS (max_latency));

      /* we are always live, the min latency is 1 frame and the max latency is
       * the complete buffer of frames. */
      gst_query_set_latency (query, TRUE, min_latency, max_latency);

      ret = TRUE;
      break;
    }
    default:
      ret = gst_pad_query_default (pad, parent, query);
      break;
  }

done:
  return ret;
}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:51,代码来源:gstdecklinksrc.cpp

示例13: gst_decklink_src_audio_src_getrange

static GstFlowReturn
gst_decklink_src_audio_src_getrange (GstPad * pad, guint64 offset, guint length,
                                     GstBuffer ** buffer)
{
    GstDecklinkSrc *decklinksrc;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "getrange");


    gst_object_unref (decklinksrc);
    return GST_FLOW_OK;
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:14,代码来源:gstdecklinksrc.cpp

示例14: gst_decklink_src_audio_src_getcaps

static GstCaps *
gst_decklink_src_audio_src_getcaps (GstPad * pad)
{
    GstDecklinkSrc *decklinksrc;
    GstCaps *caps;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "getcaps");

    caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));

    gst_object_unref (decklinksrc);
    return caps;
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:15,代码来源:gstdecklinksrc.cpp

示例15: gst_decklink_src_audio_src_iterintlink

static GstIterator *
gst_decklink_src_audio_src_iterintlink (GstPad * pad)
{
    GstDecklinkSrc *decklinksrc;
    GstIterator *iter;

    decklinksrc = GST_DECKLINK_SRC (gst_pad_get_parent (pad));

    GST_DEBUG_OBJECT (decklinksrc, "iterintlink");

    iter = gst_pad_iterate_internal_links_default (pad);

    gst_object_unref (decklinksrc);
    return iter;
}
开发者ID:nezticle,项目名称:gst-plugins-bad-free,代码行数:15,代码来源:gstdecklinksrc.cpp


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