Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions local/owr_media_renderer.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,27 @@ static void on_caps(GstElement *sink, GParamSpec *pspec, OwrMediaRenderer *media
}
}

void owr_media_renderer_set_state(OwrMediaRenderer *_renderer, OwrMediaRendererState state)
{
OwrMediaRenderer* renderer;
OwrMediaRendererPrivate *priv;

renderer = OWR_MEDIA_RENDERER(_renderer);
priv = renderer->priv;

if (!priv->pipeline)
return;

switch (state) {
case OWR_MEDIA_RENDERER_PAUSE:
gst_element_set_state(priv->pipeline, GST_STATE_PAUSED);
break;
case OWR_MEDIA_RENDERER_PLAY:
gst_element_set_state(priv->pipeline, GST_STATE_PLAYING);
break;
}
}

static void maybe_start_renderer(OwrMediaRenderer *renderer)
{
OwrMediaRendererPrivate *priv;
Expand Down
8 changes: 8 additions & 0 deletions local/owr_media_renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ struct _OwrMediaRendererClass {
void *(*get_sink)(OwrMediaRenderer *renderer);
};

typedef enum {
OWR_MEDIA_RENDERER_PAUSE = 0,
OWR_MEDIA_RENDERER_PLAY = 1
} OwrMediaRendererState;


GType owr_media_renderer_get_type(void) G_GNUC_CONST;

void owr_media_renderer_set_source(OwrMediaRenderer *renderer, OwrMediaSource *source);
gchar * owr_media_renderer_get_dot_data(OwrMediaRenderer *renderer);

void owr_media_renderer_set_state(OwrMediaRenderer *_renderer, OwrMediaRendererState state);

G_END_DECLS

#endif /* __OWR_MEDIA_RENDERER_H__ */