* as soon as we've trashed Gtk-1.2, change 'gint palette'
to 'guint16 palette' in gstv4lsrc.[ch]
* v4lsrc: actually try the format out on capsnego
+* all plugins: on try_set_caps(), loop try_set_caps() per caps
+ instead of using a multi-caps so we know the end-format
* all three: fix interlacing (not handled at all...)
* add overlay handling in v4lelement
* libgstrec
* avidemux: add events (seek)
-* avimux: fps calculations
+* avimux: fps calculations (or make that a set/get_property()?)
TODO list (long term):
======================
enum {
ARG_0,
ARG_CHANNEL,
- ARG_CHANNEL_NAME,
+ ARG_CHANNEL_NAMES,
ARG_NORM,
- ARG_NORM_NAME,
+ ARG_NORM_NAMES,
ARG_HAS_TUNER,
ARG_FREQUENCY,
ARG_HAS_AUDIO,
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CHANNEL,
g_param_spec_int("channel","channel","channel",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE));
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CHANNEL_NAME,
- g_param_spec_string("channel_name","channel_name","channel_name",
- NULL, G_PARAM_READABLE));
+ g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CHANNEL_NAMES,
+ g_param_spec_pointer("channel_names","channel_names","channel_names",
+ G_PARAM_READABLE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NORM,
g_param_spec_int("norm","norm","norm",
G_MININT,G_MAXINT,0,G_PARAM_READWRITE));
- g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NORM_NAME,
- g_param_spec_string("norm_name","norm_name","norm_name",
- NULL, G_PARAM_READABLE));
+ g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NORM_NAMES,
+ g_param_spec_pointer("norm_names","norm_names","norm_names",
+ G_PARAM_READABLE));
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_HAS_TUNER,
g_param_spec_boolean("has_tuner","has_tuner","has_tuner",
GstV4lElement *v4lelement;
gint temp_i = 0;
gulong temp_ul = 0;
+ GList *list = NULL;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail(GST_IS_V4LELEMENT(object));
gst_v4l_get_chan_norm(v4lelement, &temp_i, NULL);
g_value_set_int(value, temp_i);
break;
- case ARG_CHANNEL_NAME:
+ case ARG_CHANNEL_NAMES:
if (GST_V4L_IS_OPEN(v4lelement))
- g_value_set_string(value, g_strdup(v4lelement->vchan.name));
- else
- g_value_set_string(value, g_strdup("Unknown"));
+ list = gst_v4l_get_chan_names(v4lelement);
+ g_value_set_pointer(value, (gpointer)list);
break;
case ARG_NORM:
if (GST_V4L_IS_OPEN(v4lelement))
gst_v4l_get_chan_norm(v4lelement, NULL, &temp_i);
g_value_set_int(value, temp_i);
break;
- case ARG_NORM_NAME:
- if (GST_V4L_IS_OPEN(v4lelement))
- {
- gst_v4l_get_chan_norm(v4lelement, NULL, &temp_i);
- g_value_set_string(value, g_strdup(norm_name[temp_i]));
- }
- else
- g_value_set_string(value, g_strdup("Unknwon"));
+ case ARG_NORM_NAMES:
+ for (temp_i=0;norm_name[temp_i]!=NULL;temp_i++)
+ list = g_list_append(list, (gpointer)g_strdup(norm_name[temp_i]));
+ g_value_set_pointer(value, (gpointer)list);
break;
case ARG_HAS_TUNER:
g_value_set_boolean(value, FALSE);
case ARG_HEIGHT:
g_value_set_int(value, v4lmjpegsrc->end_height);
break;
+ case ARG_X_OFFSET:
+ g_value_set_int(value, v4lmjpegsrc->x_offset);
+ break;
+ case ARG_Y_OFFSET:
+ g_value_set_int(value, v4lmjpegsrc->y_offset);
+ break;
+ case ARG_F_WIDTH:
+ g_value_set_int(value, v4lmjpegsrc->frame_width);
+ break;
+ case ARG_F_HEIGHT:
+ g_value_set_int(value, v4lmjpegsrc->frame_height);
+ break;
+ case ARG_H_DECIMATION:
+ g_value_set_int(value, v4lmjpegsrc->horizontal_decimation);
+ break;
+ case ARG_V_DECIMATION:
+ g_value_set_int(value, v4lmjpegsrc->vertical_decimation);
+ break;
+ case ARG_QUALITY:
+ g_value_set_int(value, v4lmjpegsrc->quality);
+ break;
case ARG_NUMBUFS:
g_value_set_int(value, v4lmjpegsrc->breq.count);
break;
#include "v4l_calls.h"
-char *picture_name[] = { "Hue", "Brightness", "Contrast", "Saturation" };
+char *picture_name[] = { "Hue", "Brightness", "Contrast", "Saturation", NULL };
-char *audio_name[] = { "Volume", "Mute", "Mode" };
+char *audio_name[] = { "Volume", "Mute", "Mode", NULL };
-char *norm_name[] = { "PAL", "NTSC", "SECAM", "Autodetect" };
+char *norm_name[] = { "PAL", "NTSC", "SECAM", NULL };
/******************************************************
* gst_v4l_get_capabilities():
return FALSE;
}
- g_message("Opened device \'%s\' (\'%s\') successfully\n",
+ gst_info("Opened device \'%s\' (\'%s\') successfully\n",
v4lelement->vcap.name, v4lelement->videodev);
return TRUE;
}
+/******************************************************
+ * gst_v4l_get_chan_names()
+ * return value: a GList containing the channel names
+ ******************************************************/
+
+GList *
+gst_v4l_get_chan_names (GstV4lElement *v4lelement)
+{
+ struct video_channel vchan;
+ GList *list = NULL;
+ gint i;
+
+#ifdef DEBUG
+ fprintf(stderr, "V4L: gst_v4l_get_chan_names()\n");
+#endif
+
+ if (!GST_V4L_IS_OPEN(v4lelement))
+ return NULL;
+
+ for (i=0;i<gst_v4l_get_num_chans(v4lelement);i++)
+ {
+ vchan.channel = i;
+ if (ioctl(v4lelement->video_fd, VIDIOCGCHAN, &vchan) < 0)
+ return NULL;
+ list = g_list_append(list, (gpointer)g_strdup(vchan.name));
+ }
+
+ return list;
+}
+
+
/******************************************************
* gst_v4l_get_chan_norm():
* get the currently active video-channel and it's
gint gst_v4l_get_num_chans (GstV4lElement *v4lelement);
gboolean gst_v4l_get_chan_norm (GstV4lElement *v4lelement, gint *channel, gint *norm);
gboolean gst_v4l_set_chan_norm (GstV4lElement *v4lelement, gint channel, gint norm);
+GList *gst_v4l_get_chan_names (GstV4lElement *v4lelement);
/* frequency control */
gboolean gst_v4l_has_tuner (GstV4lElement *v4lelement);
return FALSE;
}
- g_message("Got %ld buffers of size %ld KB\n",
+ gst_info("Got %ld buffers of size %ld KB\n",
v4lmjpegsink->breq.count, v4lmjpegsink->breq.size/1024);
/* Map the buffers */
for (n=V4L_MJPEG_INPUT_COMPOSITE;n<V4L_MJPEG_INPUT_AUTO;n++)
{
- g_message("Trying %s as input...\n",
+ gst_info("Trying %s as input...\n",
input_name[n]);
bstat.input = n;
input = bstat.input;
if (norm == VIDEO_MODE_AUTO)
norm = bstat.norm;
- g_message("Signal found: on input %s, norm %s\n",
+ gst_info("Signal found: on input %s, norm %s\n",
input_name[bstat.input], norm_name[bstat.norm]);
break;
}
if (bstat.signal)
{
norm = bstat.norm;
- g_message("Norm %s detected on input %s\n",
+ gst_info("Norm %s detected on input %s\n",
norm_name[bstat.norm], input_name[input]);
GST_V4LELEMENT(v4lmjpegsrc)->norm = norm;
}
return FALSE;
}
- g_message("Got %ld buffers of size %ld KB\n",
+ gst_info("Got %ld buffers of size %ld KB\n",
v4lmjpegsrc->breq.count, v4lmjpegsrc->breq.size/1024);
/* Map the buffers */
return FALSE;
}
- g_message("Got %d buffers (\'%s\') of size %d KB\n",
+ gst_info("Got %d buffers (\'%s\') of size %d KB\n",
v4lsrc->mbuf.frames, palette_name[v4lsrc->mmap.format],
v4lsrc->mbuf.size/(v4lsrc->mbuf.frames*1024));