Remove some unused things.
Work on shutdown.
This commit is contained in:
Wim Taymans 2016-09-01 10:04:25 +02:00
parent 9485bd77e7
commit 463954a299
17 changed files with 166 additions and 99 deletions

View file

@ -48,8 +48,21 @@ struct _SpaHandle {
SpaResult (*get_interface) (SpaHandle *handle,
uint32_t interface_id,
void **interface);
/**
* SpaHandle::clear
* @handle: a pointer to memory
*
* Clean up the memory of @handle. After this, @handle should not be used
* anymore.
*
* Returns: #SPA_RESULT_OK on success
*/
SpaResult (*clear) (SpaHandle *handle);
};
#define spa_handle_get_interface(h,...) (h)->get_interface((h),__VA_ARGS__)
#define spa_handle_clear(h) (h)->clear((h))
/**
* SpaInterfaceInfo:
* @interface_id: the id of the interface, can be used to get the interface
@ -99,6 +112,7 @@ struct _SpaHandleFactory {
*/
SpaResult (*init) (const SpaHandleFactory *factory,
SpaHandle *handle);
/**
* SpaHandle::enum_interface_info:
* @factory: a #SpaHandleFactory
@ -117,6 +131,9 @@ struct _SpaHandleFactory {
void **state);
};
#define spa_handle_factory_init(h,...) (h)->init((h),__VA_ARGS__)
#define spa_handle_factory_enum_interface_info(h,...) (h)->enum_interface_info((h),__VA_ARGS__)
/**
* SpaEnumHandleFactoryFunc:
* @factory: a location to hold the factory result

View file

@ -149,7 +149,7 @@ spa_memory_alloc_with_fd (uint32_t pool_id, void *data, size_t size)
if (!(mem = spa_memory_alloc (pool_id)))
return NULL;
#if 0
#if 1
{
char filename[] = "/dev/shm/spa-tmpfile.XXXXXX";
mem->fd = mkostemp (filename, O_CLOEXEC);
@ -176,7 +176,7 @@ spa_memory_alloc_with_fd (uint32_t pool_id, void *data, size_t size)
return NULL;
}
}
#if 1
#if 0
{
unsigned int seals;

View file

@ -678,6 +678,12 @@ spa_alsa_sink_get_interface (SpaHandle *handle,
return SPA_RESULT_OK;
}
static SpaResult
alsa_sink_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
alsa_sink_init (const SpaHandleFactory *factory,
SpaHandle *handle)
@ -688,6 +694,7 @@ alsa_sink_init (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_alsa_sink_get_interface;
handle->clear = alsa_sink_clear;
this = (SpaALSASink *) handle;
this->node = alsasink_node;

View file

@ -770,6 +770,12 @@ spa_audiomixer_get_interface (SpaHandle *handle,
return SPA_RESULT_OK;
}
static SpaResult
spa_audiomixer_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
spa_audiomixer_init (const SpaHandleFactory *factory,
SpaHandle *handle)
@ -780,6 +786,7 @@ spa_audiomixer_init (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_audiomixer_get_interface;
handle->clear = spa_audiomixer_clear;
this = (SpaAudioMixer *) handle;
this->node = audiomixer_node;

View file

@ -555,6 +555,12 @@ spa_audiotestsrc_get_interface (SpaHandle *handle,
return SPA_RESULT_OK;
}
static SpaResult
audiotestsrc_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
audiotestsrc_init (const SpaHandleFactory *factory,
SpaHandle *handle)
@ -565,6 +571,7 @@ audiotestsrc_init (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_audiotestsrc_get_interface;
handle->clear = audiotestsrc_clear;
this = (SpaAudioTestSrc *) handle;
this->node = audiotestsrc_node;

View file

@ -1121,8 +1121,14 @@ spa_proxy_get_interface (SpaHandle *handle,
}
static SpaResult
proxy_instantiate (const SpaHandleFactory *factory,
SpaHandle *handle)
proxy_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
proxy_init (const SpaHandleFactory *factory,
SpaHandle *handle)
{
SpaProxy *this;
@ -1130,6 +1136,7 @@ proxy_instantiate (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_proxy_get_interface;
handle->clear = proxy_clear;
this = (SpaProxy *) handle;
this->node = proxy_node;
@ -1189,6 +1196,6 @@ const SpaHandleFactory spa_proxy_factory =
{ "proxy",
NULL,
sizeof (SpaProxy),
proxy_instantiate,
proxy_init,
proxy_enum_interface_info,
};

View file

@ -763,6 +763,12 @@ spa_v4l2_source_get_interface (SpaHandle *handle,
return SPA_RESULT_OK;
}
static SpaResult
v4l2_source_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
v4l2_source_init (const SpaHandleFactory *factory,
SpaHandle *handle)
@ -773,6 +779,7 @@ v4l2_source_init (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_v4l2_source_get_interface;
handle->clear = v4l2_source_clear,
this = (SpaV4l2Source *) handle;
this->node = v4l2source_node;

View file

@ -667,8 +667,14 @@ spa_volume_get_interface (SpaHandle *handle,
}
static SpaResult
volume_instantiate (const SpaHandleFactory *factory,
SpaHandle *handle)
volume_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
volume_init (const SpaHandleFactory *factory,
SpaHandle *handle)
{
SpaVolume *this;
@ -676,6 +682,7 @@ volume_instantiate (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_volume_get_interface;
handle->clear = volume_clear;
this = (SpaVolume *) handle;
this->node = volume_node;
@ -732,6 +739,6 @@ const SpaHandleFactory spa_volume_factory =
{ "volume",
NULL,
sizeof (SpaVolume),
volume_instantiate,
volume_init,
volume_enum_interface_info,
};

View file

@ -545,6 +545,12 @@ spa_xv_sink_get_interface (SpaHandle *handle,
return SPA_RESULT_OK;
}
static SpaResult
xv_sink_clear (SpaHandle *handle)
{
return SPA_RESULT_OK;
}
static SpaResult
xv_sink_init (const SpaHandleFactory *factory,
SpaHandle *handle)
@ -555,6 +561,7 @@ xv_sink_init (const SpaHandleFactory *factory,
return SPA_RESULT_INVALID_ARGUMENTS;
handle->get_interface = spa_xv_sink_get_interface;
handle->clear = xv_sink_clear;
this = (SpaXvSink *) handle;
this->node = xvsink_node;