mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
camerabin: add debug including dot graph writing
This commit is contained in:
parent
430f343522
commit
683b72a5fe
3 changed files with 21 additions and 3 deletions
|
@ -150,9 +150,9 @@ gst_camerabin_try_add_element (GstBin * bin, GstElement * new_elem)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get pads for linking */
|
/* Get pads for linking */
|
||||||
GST_DEBUG ("finding unconnected src pad");
|
|
||||||
bin_pad = gst_bin_find_unlinked_pad (bin, GST_PAD_SRC);
|
bin_pad = gst_bin_find_unlinked_pad (bin, GST_PAD_SRC);
|
||||||
GST_DEBUG ("unconnected pad %s:%s", GST_DEBUG_PAD_NAME (bin_pad));
|
GST_DEBUG ("adding %" GST_PTR_FORMAT " to %s:%s", new_elem,
|
||||||
|
GST_DEBUG_PAD_NAME (bin_pad));
|
||||||
/* Add to bin */
|
/* Add to bin */
|
||||||
gst_bin_add (GST_BIN (bin), new_elem);
|
gst_bin_add (GST_BIN (bin), new_elem);
|
||||||
/* Link, if unconnected pad was found, otherwise just add it to bin */
|
/* Link, if unconnected pad was found, otherwise just add it to bin */
|
||||||
|
@ -185,7 +185,6 @@ gst_camerabin_create_and_add_element (GstBin * bin, const gchar * elem_name)
|
||||||
{
|
{
|
||||||
GstElement *new_elem = NULL;
|
GstElement *new_elem = NULL;
|
||||||
|
|
||||||
GST_DEBUG ("adding %s", elem_name);
|
|
||||||
new_elem = gst_element_factory_make (elem_name, NULL);
|
new_elem = gst_element_factory_make (elem_name, NULL);
|
||||||
if (!new_elem) {
|
if (!new_elem) {
|
||||||
GST_ELEMENT_ERROR (bin, CORE, MISSING_PLUGIN, (NULL),
|
GST_ELEMENT_ERROR (bin, CORE, MISSING_PLUGIN, (NULL),
|
||||||
|
|
|
@ -196,6 +196,7 @@ gst_camerabin_image_change_state (GstElement * element,
|
||||||
{
|
{
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstCameraBinImage *img = GST_CAMERABIN_IMAGE (element);
|
GstCameraBinImage *img = GST_CAMERABIN_IMAGE (element);
|
||||||
|
GstObject *camerabin = NULL;
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
|
@ -221,6 +222,14 @@ gst_camerabin_image_change_state (GstElement * element,
|
||||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||||
|
camerabin = gst_element_get_parent (img);
|
||||||
|
/* Write debug graph to file */
|
||||||
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camerabin),
|
||||||
|
GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE |
|
||||||
|
GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS, "imagebin.playing");
|
||||||
|
gst_object_unref (camerabin);
|
||||||
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
gst_camerabin_image_destroy_elements (img);
|
gst_camerabin_image_destroy_elements (img);
|
||||||
break;
|
break;
|
||||||
|
@ -530,6 +539,7 @@ gst_camerabin_image_destroy_elements (GstCameraBinImage * img)
|
||||||
void
|
void
|
||||||
gst_camerabin_image_set_encoder (GstCameraBinImage * img, GstElement * encoder)
|
gst_camerabin_image_set_encoder (GstCameraBinImage * img, GstElement * encoder)
|
||||||
{
|
{
|
||||||
|
GST_DEBUG ("setting encoder %" GST_PTR_FORMAT, encoder);
|
||||||
if (img->user_enc)
|
if (img->user_enc)
|
||||||
gst_object_unref (img->user_enc);
|
gst_object_unref (img->user_enc);
|
||||||
if (encoder)
|
if (encoder)
|
||||||
|
@ -542,6 +552,7 @@ void
|
||||||
gst_camerabin_image_set_postproc (GstCameraBinImage * img,
|
gst_camerabin_image_set_postproc (GstCameraBinImage * img,
|
||||||
GstElement * postproc)
|
GstElement * postproc)
|
||||||
{
|
{
|
||||||
|
GST_DEBUG ("setting post processing element %" GST_PTR_FORMAT, postproc);
|
||||||
if (img->post)
|
if (img->post)
|
||||||
gst_object_unref (img->post);
|
gst_object_unref (img->post);
|
||||||
if (postproc)
|
if (postproc)
|
||||||
|
|
|
@ -290,6 +290,7 @@ gst_camerabin_video_change_state (GstElement * element,
|
||||||
{
|
{
|
||||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||||
GstCameraBinVideo *vid = GST_CAMERABIN_VIDEO (element);
|
GstCameraBinVideo *vid = GST_CAMERABIN_VIDEO (element);
|
||||||
|
GstObject *camerabin = NULL;
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||||
|
@ -325,6 +326,13 @@ gst_camerabin_video_change_state (GstElement * element,
|
||||||
|
|
||||||
switch (transition) {
|
switch (transition) {
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||||
|
camerabin = gst_element_get_parent (vid);
|
||||||
|
/* Write debug graph to file */
|
||||||
|
GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camerabin),
|
||||||
|
GST_DEBUG_GRAPH_SHOW_MEDIA_TYPE |
|
||||||
|
GST_DEBUG_GRAPH_SHOW_NON_DEFAULT_PARAMS, "videobin.playing");
|
||||||
|
gst_object_unref (camerabin);
|
||||||
|
|
||||||
if (vid->pending_eos) {
|
if (vid->pending_eos) {
|
||||||
/* Video bin is still paused, so push eos directly to video queue */
|
/* Video bin is still paused, so push eos directly to video queue */
|
||||||
GST_DEBUG_OBJECT (vid, "pushing pending eos");
|
GST_DEBUG_OBJECT (vid, "pushing pending eos");
|
||||||
|
|
Loading…
Reference in a new issue