Remove old code
Only depend on GStreamer for the plugins
Rename STOP to PAUSE because that's what it really does
Start working on format_fixate.
Remove default property value from props
Fix framerate
This commit is contained in:
Wim Taymans 2016-08-25 14:10:38 +02:00
parent da5fb808e7
commit fbd6304663
43 changed files with 97 additions and 3631 deletions

View file

@ -142,21 +142,18 @@ static const SpaPropInfo prop_info[] =
{ PROP_ID_DEVICE, "device", "V4l2 device location",
SPA_PROP_FLAG_READWRITE,
SPA_PROP_TYPE_STRING, 63,
strlen (default_device)+1, default_device,
SPA_PROP_RANGE_TYPE_NONE, 0, NULL,
NULL,
offsetof (SpaV4l2SourceProps, device) },
{ PROP_ID_DEVICE_NAME, "device-name", "Human-readable name of the device",
SPA_PROP_FLAG_READABLE,
SPA_PROP_TYPE_STRING, 127,
0, NULL,
SPA_PROP_RANGE_TYPE_NONE, 0, NULL,
NULL,
offsetof (SpaV4l2SourceProps, device_name) },
{ PROP_ID_DEVICE_FD, "device-fd", "Device file descriptor",
SPA_PROP_FLAG_READABLE,
SPA_PROP_TYPE_UINT32, sizeof (uint32_t),
0, NULL,
SPA_PROP_RANGE_TYPE_NONE, 0, NULL,
NULL,
offsetof (SpaV4l2SourceProps, device_fd) },
@ -237,7 +234,7 @@ spa_v4l2_source_node_send_command (SpaNode *node,
send_state_change (this, SPA_NODE_STATE_STREAMING);
break;
case SPA_COMMAND_STOP:
case SPA_COMMAND_PAUSE:
spa_v4l2_stop (this);
send_state_change (this, SPA_NODE_STATE_PAUSED);

View file

@ -385,13 +385,13 @@ spa_v4l2_set_format (SpaV4l2Source *this, V4l2Format *f, bool try_only)
fmt.fmt.pix.field = V4L2_FIELD_ANY;
fmt.fmt.pix.width = f->size.width;
fmt.fmt.pix.height = f->size.height;
streamparm.parm.capture.timeperframe.numerator = f->framerate.denom;
streamparm.parm.capture.timeperframe.denominator = f->framerate.num;
streamparm.parm.capture.timeperframe.numerator = f->framerate.num;
streamparm.parm.capture.timeperframe.denominator = f->framerate.denom;
fprintf (stderr, "set %08x %dx%d %d/%d\n", fmt.fmt.pix.pixelformat,
fmt.fmt.pix.width, fmt.fmt.pix.height,
streamparm.parm.capture.timeperframe.denominator,
streamparm.parm.capture.timeperframe.numerator);
streamparm.parm.capture.timeperframe.numerator,
streamparm.parm.capture.timeperframe.denominator);
reqfmt = fmt;
@ -407,6 +407,11 @@ spa_v4l2_set_format (SpaV4l2Source *this, V4l2Format *f, bool try_only)
if (xioctl (state->fd, VIDIOC_S_PARM, &streamparm) < 0)
perror ("VIDIOC_S_PARM");
fprintf (stderr, "got %08x %dx%d %d/%d\n", fmt.fmt.pix.pixelformat,
fmt.fmt.pix.width, fmt.fmt.pix.height,
streamparm.parm.capture.timeperframe.numerator,
streamparm.parm.capture.timeperframe.denominator);
if (reqfmt.fmt.pix.pixelformat != fmt.fmt.pix.pixelformat ||
reqfmt.fmt.pix.width != fmt.fmt.pix.width ||
reqfmt.fmt.pix.height != fmt.fmt.pix.height)