Improve negotiation

Fix selection of the default property value by restricting it to
something in the valid range of the property.
Fix audio/videotestsrc reuse
Fix format enum with filters.
Fix module property configuration
Fix connection refill
This commit is contained in:
Wim Taymans 2017-03-01 14:07:02 +01:00
parent 282995d0d0
commit 710a1a41e6
13 changed files with 131 additions and 81 deletions

View file

@ -29,7 +29,7 @@
#include "serialize.h"
#include "log.h"
#define MAX_BUFFER_SIZE 4096
#define MAX_BUFFER_SIZE 1024
#define MAX_FDS 28
typedef struct {
@ -1005,9 +1005,6 @@ refill_buffer (PinosConnection *conn, ConnectionBuffer *buf)
break;
}
if (len < 8)
return false;
buf->buffer_size += len;
/* handle control messages */

View file

@ -34,7 +34,7 @@ static SpaResult
setup_video_node (SpaNode *spa_node, PinosProperties *pinos_props) {
SpaResult res;
SpaProps *props;
// SpaPropValue value;
SpaPODProp *prop;
const char *pattern;
uint32_t pattern_int;
@ -49,15 +49,15 @@ setup_video_node (SpaNode *spa_node, PinosProperties *pinos_props) {
return SPA_RESULT_ERROR;
}
//// value.value = &pattern_int;
// value.size = sizeof(uint32_t);
if ((res = spa_node_get_props (spa_node, &props)) != SPA_RESULT_OK) {
pinos_log_debug ("spa_node_get_props failed: %d", res);
return SPA_RESULT_ERROR;
}
// spa_props_set_value (props, spa_props_index_for_name (props, "pattern"), &value);
if ((prop = spa_pod_object_find_prop (props, 2))) {
if (prop->body.value.type == SPA_POD_TYPE_INT)
((SpaPODInt*)&prop->body.value)->value = pattern_int;
}
if ((res = spa_node_set_props (spa_node, props)) != SPA_RESULT_OK) {
pinos_log_debug ("spa_node_set_props failed: %d", res);

View file

@ -99,7 +99,6 @@ do_negotiate (PinosLink *this, SpaNodeState in_state, SpaNodeState out_state)
NULL,
&error);
if (format == NULL) {
asprintf (&error, "no common format found");
goto error;
}