mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-17 08:56:49 -05:00
Remove direction
Direction is tied to the port id. Handle nodes with fixed ports.
This commit is contained in:
parent
7d8e2d53f7
commit
9485bd77e7
25 changed files with 246 additions and 165 deletions
|
|
@ -213,7 +213,6 @@ update_state (SpaV4l2Source *this, SpaNodeState state)
|
|||
this->node_state = state;
|
||||
|
||||
event.type = SPA_EVENT_TYPE_STATE_CHANGE;
|
||||
event.port_id = -1;
|
||||
event.data = ≻
|
||||
event.size = sizeof (sc);
|
||||
sc.state = state;
|
||||
|
|
@ -309,10 +308,10 @@ spa_v4l2_source_node_get_n_ports (SpaNode *node,
|
|||
|
||||
if (n_input_ports)
|
||||
*n_input_ports = 0;
|
||||
if (n_output_ports)
|
||||
*n_output_ports = 1;
|
||||
if (max_input_ports)
|
||||
*max_input_ports = 0;
|
||||
if (n_output_ports)
|
||||
*n_output_ports = 1;
|
||||
if (max_output_ports)
|
||||
*max_output_ports = 1;
|
||||
|
||||
|
|
@ -338,7 +337,6 @@ spa_v4l2_source_node_get_port_ids (SpaNode *node,
|
|||
|
||||
static SpaResult
|
||||
spa_v4l2_source_node_add_port (SpaNode *node,
|
||||
SpaDirection direction,
|
||||
uint32_t port_id)
|
||||
{
|
||||
return SPA_RESULT_NOT_IMPLEMENTED;
|
||||
|
|
@ -383,6 +381,8 @@ spa_v4l2_source_node_port_enum_formats (SpaNode *node,
|
|||
|
||||
this = (SpaV4l2Source *) node->handle;
|
||||
|
||||
fprintf (stderr, "%d\n", port_id);
|
||||
|
||||
if (port_id != 0)
|
||||
return SPA_RESULT_INVALID_PORT;
|
||||
|
||||
|
|
|
|||
|
|
@ -583,14 +583,15 @@ v4l2_on_fd_events (SpaPollNotifyData *data)
|
|||
{
|
||||
SpaV4l2Source *this = data->user_data;
|
||||
SpaEvent event;
|
||||
SpaEventHaveOutput ho;
|
||||
|
||||
if (mmap_read (this) < 0)
|
||||
return 0;
|
||||
|
||||
event.type = SPA_EVENT_TYPE_HAVE_OUTPUT;
|
||||
event.port_id = 0;
|
||||
event.size = 0;
|
||||
event.data = NULL;
|
||||
event.size = sizeof (ho);
|
||||
event.data = &ho;
|
||||
ho.port_id = 0;
|
||||
this->event_cb (&this->node, &event, this->user_data);
|
||||
|
||||
return 0;
|
||||
|
|
@ -856,7 +857,6 @@ spa_v4l2_start (SpaV4l2Source *this)
|
|||
}
|
||||
|
||||
event.type = SPA_EVENT_TYPE_ADD_POLL;
|
||||
event.port_id = 0;
|
||||
event.data = &state->poll;
|
||||
event.size = sizeof (state->poll);
|
||||
|
||||
|
|
@ -884,7 +884,6 @@ spa_v4l2_pause (SpaV4l2Source *this)
|
|||
SpaEvent event;
|
||||
|
||||
event.type = SPA_EVENT_TYPE_REMOVE_POLL;
|
||||
event.port_id = 0;
|
||||
event.data = &state->poll;
|
||||
event.size = sizeof (state->poll);
|
||||
this->event_cb (&this->node, &event, this->user_data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue