mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-25 06:59:57 -05:00
work on sink
This commit is contained in:
parent
bdbddaf75b
commit
a03352353f
9 changed files with 180 additions and 306 deletions
|
|
@ -414,16 +414,12 @@ gst_pinos_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
{
|
||||
GstPinosSink *pinossink;
|
||||
GPtrArray *possible;
|
||||
SpaFormat *format;
|
||||
PinosStreamState state;
|
||||
gboolean res = FALSE;
|
||||
|
||||
pinossink = GST_PINOS_SINK (bsink);
|
||||
|
||||
format = gst_caps_to_format (caps, 0);
|
||||
possible = g_ptr_array_new ();
|
||||
spa_format_ref (format);
|
||||
g_ptr_array_insert (possible, -1, format);
|
||||
possible = gst_caps_to_format_all (caps);
|
||||
|
||||
pinos_main_loop_lock (pinossink->loop);
|
||||
state = pinos_stream_get_state (pinossink->stream);
|
||||
|
|
@ -439,6 +435,7 @@ gst_pinos_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
|
||||
pinos_stream_connect (pinossink->stream,
|
||||
PINOS_DIRECTION_OUTPUT,
|
||||
PINOS_STREAM_MODE_BUFFER,
|
||||
pinossink->path,
|
||||
flags,
|
||||
possible);
|
||||
|
|
@ -457,9 +454,7 @@ gst_pinos_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
|
|||
}
|
||||
|
||||
if (state != PINOS_STREAM_STATE_STREAMING) {
|
||||
res = pinos_stream_start (pinossink->stream,
|
||||
format,
|
||||
PINOS_STREAM_MODE_BUFFER);
|
||||
res = pinos_stream_start (pinossink->stream);
|
||||
|
||||
while (TRUE) {
|
||||
state = pinos_stream_get_state (pinossink->stream);
|
||||
|
|
@ -483,7 +478,7 @@ start_error:
|
|||
{
|
||||
GST_ERROR ("could not start stream");
|
||||
pinos_main_loop_unlock (pinossink->loop);
|
||||
spa_format_unref (format);
|
||||
g_ptr_array_unref (possible);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -484,19 +484,14 @@ parse_stream_properties (GstPinosSrc *pinossrc, PinosProperties *props)
|
|||
|
||||
|
||||
static gboolean
|
||||
gst_pinos_src_stream_start (GstPinosSrc *pinossrc, GstCaps * caps)
|
||||
gst_pinos_src_stream_start (GstPinosSrc *pinossrc)
|
||||
{
|
||||
SpaFormat *format;
|
||||
gboolean res;
|
||||
PinosProperties *props;
|
||||
|
||||
if (caps)
|
||||
format = gst_caps_to_format (caps, 0);
|
||||
else
|
||||
format = NULL;
|
||||
|
||||
pinos_main_loop_lock (pinossrc->loop);
|
||||
res = pinos_stream_start (pinossrc->stream, format, PINOS_STREAM_MODE_BUFFER);
|
||||
res = pinos_stream_start (pinossrc->stream);
|
||||
while (TRUE) {
|
||||
PinosStreamState state = pinos_stream_get_state (pinossrc->stream);
|
||||
|
||||
|
|
@ -515,8 +510,9 @@ gst_pinos_src_stream_start (GstPinosSrc *pinossrc, GstCaps * caps)
|
|||
pinos_main_loop_unlock (pinossrc->loop);
|
||||
|
||||
if (format) {
|
||||
caps = gst_caps_from_format (format);
|
||||
GstCaps *caps = gst_caps_from_format (format);
|
||||
gst_base_src_set_caps (GST_BASE_SRC (pinossrc), caps);
|
||||
gst_caps_unref (caps);
|
||||
spa_format_unref (format);
|
||||
}
|
||||
|
||||
|
|
@ -609,6 +605,7 @@ gst_pinos_src_negotiate (GstBaseSrc * basesrc)
|
|||
GST_DEBUG_OBJECT (basesrc, "connect capture with path %s", pinossrc->path);
|
||||
pinos_stream_connect (pinossrc->stream,
|
||||
PINOS_DIRECTION_INPUT,
|
||||
PINOS_STREAM_MODE_BUFFER,
|
||||
pinossrc->path,
|
||||
PINOS_STREAM_FLAG_AUTOCONNECT,
|
||||
possible);
|
||||
|
|
@ -626,7 +623,7 @@ gst_pinos_src_negotiate (GstBaseSrc * basesrc)
|
|||
}
|
||||
pinos_main_loop_unlock (pinossrc->loop);
|
||||
|
||||
result = gst_pinos_src_stream_start (pinossrc, NULL);
|
||||
result = gst_pinos_src_stream_start (pinossrc);
|
||||
|
||||
pinossrc->negotiated = result;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue