Add flags to set_format

Use flags to control the behaviour of set_format
Move poll into separate file
This commit is contained in:
Wim Taymans 2016-07-18 10:35:02 +02:00
parent b9320c67c2
commit 96df59274c
11 changed files with 146 additions and 97 deletions

View file

@ -278,10 +278,10 @@ spa_ffmpeg_dec_node_port_enum_formats (SpaHandle *handle,
}
static SpaResult
spa_ffmpeg_dec_node_port_set_format (SpaHandle *handle,
uint32_t port_id,
bool test_only,
const SpaFormat *format)
spa_ffmpeg_dec_node_port_set_format (SpaHandle *handle,
uint32_t port_id,
SpaPortFormatFlags flags,
const SpaFormat *format)
{
SpaFFMpegDec *this = (SpaFFMpegDec *) handle;
SpaFFMpegState *state;
@ -315,7 +315,7 @@ spa_ffmpeg_dec_node_port_set_format (SpaHandle *handle,
} else
return SPA_RESULT_INVALID_MEDIA_TYPE;
if (!test_only) {
if (!(flags & SPA_PORT_FORMAT_FLAG_TEST_ONLY)) {
memcpy (tf, f, fs);
state->current_format = tf;
}

View file

@ -278,10 +278,10 @@ spa_ffmpeg_enc_node_port_enum_formats (SpaHandle *handle,
}
static SpaResult
spa_ffmpeg_enc_node_port_set_format (SpaHandle *handle,
uint32_t port_id,
bool test_only,
const SpaFormat *format)
spa_ffmpeg_enc_node_port_set_format (SpaHandle *handle,
uint32_t port_id,
SpaPortFormatFlags flags,
const SpaFormat *format)
{
SpaFFMpegEnc *this = (SpaFFMpegEnc *) handle;
SpaFFMpegState *state;
@ -315,7 +315,7 @@ spa_ffmpeg_enc_node_port_set_format (SpaHandle *handle,
} else
return SPA_RESULT_INVALID_MEDIA_TYPE;
if (!test_only) {
if (!(flags & SPA_PORT_FORMAT_FLAG_TEST_ONLY)) {
memcpy (tf, f, fs);
state->current_format = tf;
}