コード例 #1
0
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;
}
コード例 #2
0
ファイル: gstv4ltuner.c プロジェクト: ChinnaSuhas/ossbuild
static gint
gst_v4l_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel)
{
  GstV4lElement *v4lelement = GST_V4LELEMENT (tuner);
  GstV4lTunerChannel *v4lchannel = GST_V4L_TUNER_CHANNEL (channel);
  gint chan;
  guint signal = 0;

  /* assert that we're opened and that we're using a known item */
  g_return_val_if_fail (GST_V4L_IS_OPEN (v4lelement), 0);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), 0);
  g_return_val_if_fail (gst_v4l_tuner_contains_channel (v4lelement,
          v4lchannel), 0);

  gst_v4l_get_chan_norm (v4lelement, &chan, NULL);
  if (chan == GST_V4L_TUNER_CHANNEL (channel)->index &&
      GST_TUNER_CHANNEL_HAS_FLAG (channel, GST_TUNER_CHANNEL_FREQUENCY)) {
    gst_v4l_get_signal (v4lelement, v4lchannel->tuner, &signal);
  }

  return (gint) signal;
}
コード例 #3
0
gint
gst_v4l2_tuner_signal_strength (GstV4l2Object * v4l2object,
    GstTunerChannel * channel)
{
  GstV4l2TunerChannel *v4l2channel = GST_V4L2_TUNER_CHANNEL (channel);
  gint chan;
  gulong signal = 0;

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

  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)) {
      gst_v4l2_signal_strength (v4l2object, v4l2channel->tuner, &signal);
    }
  }

  return signal;
}
コード例 #4
0
ファイル: tuner.c プロジェクト: adesurya/gst-mobile
void
gst_tuner_set_frequency (GstTuner * tuner,
    GstTunerChannel * channel, gulong frequency)
{
  GstTunerInterface *iface;

  g_return_if_fail (GST_IS_TUNER (tuner));
  g_return_if_fail (GST_IS_TUNER_CHANNEL (channel));
  g_return_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY));

  iface = GST_TUNER_GET_INTERFACE (tuner);
  if (iface->set_frequency) {
    iface->set_frequency (tuner, channel, frequency);
  }
}
コード例 #5
0
ファイル: tuner.c プロジェクト: prajnashi/gst-plugins-base
void
gst_tuner_set_frequency (GstTuner * tuner,
    GstTunerChannel * channel, gulong frequency)
{
  GstTunerClass *klass;

  g_return_if_fail (GST_IS_TUNER (tuner));
  g_return_if_fail (GST_IS_TUNER_CHANNEL (channel));
  g_return_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY));

  klass = GST_TUNER_GET_CLASS (tuner);
  if (klass->set_frequency) {
    klass->set_frequency (tuner, channel, frequency);
  }
}
コード例 #6
0
ファイル: tuner.c プロジェクト: adesurya/gst-mobile
/**
 * gst_tuner_signal_strength:
 * @tuner: the #GstTuner (a #GstElement) that owns the given channel.
 * @channel: the #GstTunerChannel to get the signal strength from.
 *
 * Get the strength of the signal on this channel. Note that this
 * requires the current channel to be a "tuning" channel, i.e. a
 * channel on which frequency can be set. This can be checked using
 * GST_TUNER_CHANNEL_HAS_FLAG (), and the appropriate flag to check
 * for is GST_TUNER_CHANNEL_FREQUENCY.
 *
 * The valid range of the signal strength is indicated in the 
 * min_signal and max_signal properties of the #GstTunerChannel.
 *
 * Returns: Signal strength, or 0 on error.
 */
gint
gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel)
{
  GstTunerInterface *iface;

  g_return_val_if_fail (GST_IS_TUNER (tuner), 0);
  g_return_val_if_fail (GST_IS_TUNER_CHANNEL (channel), 0);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), 0);

  iface = GST_TUNER_GET_INTERFACE (tuner);
  if (iface->signal_strength) {
    return iface->signal_strength (tuner, channel);
  }

  return 0;
}
コード例 #7
0
ファイル: tuner.c プロジェクト: prajnashi/gst-plugins-base
/**
 * gst_tuner_signal_strength:
 * @tuner: the #GstTuner (a #GstElement) that owns the given channel.
 * @channel: the #GstTunerChannel to get the signal strength from.
 *
 * Get the strength of the signal on this channel. Note that this
 * requires the current channel to be a "tuning" channel, i.e. a
 * channel on which frequency can be set. This can be checked using
 * GST_TUNER_CHANNEL_HAS_FLAG (), and the appropriate flag to check
 * for is GST_TUNER_CHANNEL_FREQUENCY.
 *
 * The valid range of the signal strength is indicated in the 
 * min_signal and max_signal properties of the #GstTunerChannel.
 *
 * Returns: Signal strength, or 0 on error.
 */
gint
gst_tuner_signal_strength (GstTuner * tuner, GstTunerChannel * channel)
{
  GstTunerClass *klass;

  g_return_val_if_fail (GST_IS_TUNER (tuner), 0);
  g_return_val_if_fail (GST_IS_TUNER_CHANNEL (channel), 0);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), 0);

  klass = GST_TUNER_GET_CLASS (tuner);
  if (klass->signal_strength) {
    return klass->signal_strength (tuner, channel);
  }

  return 0;
}
コード例 #8
0
ファイル: tuner.c プロジェクト: adesurya/gst-mobile
gulong
gst_tuner_get_frequency (GstTuner * tuner, GstTunerChannel * channel)
{
  GstTunerInterface *iface;

  g_return_val_if_fail (GST_IS_TUNER (tuner), 0);
  g_return_val_if_fail (GST_IS_TUNER_CHANNEL (channel), 0);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), 0);

  iface = GST_TUNER_GET_INTERFACE (tuner);

  if (iface->get_frequency) {
    return iface->get_frequency (tuner, channel);
  }

  return 0;
}
コード例 #9
0
ファイル: tuner.c プロジェクト: prajnashi/gst-plugins-base
gulong
gst_tuner_get_frequency (GstTuner * tuner, GstTunerChannel * channel)
{
  GstTunerClass *klass;

  g_return_val_if_fail (GST_IS_TUNER (tuner), 0);
  g_return_val_if_fail (GST_IS_TUNER_CHANNEL (channel), 0);
  g_return_val_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY), 0);

  klass = GST_TUNER_GET_CLASS (tuner);

  if (klass->get_frequency) {
    return klass->get_frequency (tuner, channel);
  }

  return 0;
}
コード例 #10
0
ファイル: gstv4ltuner.c プロジェクト: ChinnaSuhas/ossbuild
static void
gst_v4l_tuner_set_frequency (GstTuner * tuner,
    GstTunerChannel * channel, gulong frequency)
{
  GstV4lElement *v4lelement = GST_V4LELEMENT (tuner);
  GstV4lTunerChannel *v4lchannel = GST_V4L_TUNER_CHANNEL (channel);
  gint chan;

  /* assert that we're opened and that we're using a known item */
  g_return_if_fail (GST_V4L_IS_OPEN (v4lelement));
  g_return_if_fail (GST_TUNER_CHANNEL_HAS_FLAG (channel,
          GST_TUNER_CHANNEL_FREQUENCY));
  g_return_if_fail (gst_v4l_tuner_contains_channel (v4lelement, v4lchannel));

  gst_v4l_get_chan_norm (v4lelement, &chan, NULL);
  if (chan == GST_V4L_TUNER_CHANNEL (channel)->index) {
    gst_v4l_set_frequency (v4lelement, v4lchannel->tuner, frequency);
  }
}