After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755642 - decklinkvideosrc: video fails to restart in ntsp-p mode
decklinkvideosrc: video fails to restart in ntsp-p mode
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.5.91
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-25 18:32 UTC by Jeff
Modified: 2018-11-03 13:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
log output from application (1.37 KB, text/plain)
2015-09-25 18:32 UTC, Jeff
Details

Description Jeff 2015-09-25 18:32:10 UTC
Created attachment 312162 [details]
log output from application

The pipeline fails to start when the decklinkvideosrc mode is set to ntsp-p.  Code to reproduce

#include <gst/gst.h>
#include <glib.h>

static gboolean
bus_call (GstBus     *bus,
          GstMessage *msg,
          gpointer    data)
{
  GMainLoop *loop = (GMainLoop *) data;

  switch (GST_MESSAGE_TYPE (msg)) {

    case GST_MESSAGE_EOS:
      g_print ("End of stream\n");
      g_main_loop_quit (loop);
      break;

    case GST_MESSAGE_ERROR: {
      gchar  *debug;
      GError *error;

      gst_message_parse_error (msg, &error, &debug);
      g_free (debug);

      g_printerr ("Error: %s\n", error->message);
      g_error_free (error);

      g_main_loop_quit (loop);
      break;
    }
    default:
      break;
  }

  return TRUE;
}

void printStateChange(GstStateChangeReturn value) {
  switch(value) {
    case GST_STATE_CHANGE_FAILURE:
      g_print("GST_STATE_CHANGE_FAILURE\n");
      break;
    case GST_STATE_CHANGE_SUCCESS:
      g_print("GST_STATE_CHANGE_SUCCESS\n");
      break;
    case GST_STATE_CHANGE_ASYNC:
      g_print("GST_STATE_CHANGE_ASYNC\n");
      break;
    case GST_STATE_CHANGE_NO_PREROLL:
      g_print("GST_STATE_CHANGE_NO_PREROLL\n");
      break;
    default:
      g_print("Unknown state\n");
      break;
      
      return;
  }
}

GstStateChangeReturn handleAsync(GstElement *element) {
  GstState *currentState = NULL, *pendingState = NULL;
  GstClockTime timeout = GST_CLOCK_TIME_NONE;
  GstStateChangeReturn result;
  
  g_print("handeling state\n");
  result = gst_element_get_state(element, currentState, pendingState, timeout);
  printStateChange(result);
  
  return result;
}

int
main (int   argc,
      char *argv[])
{
  GMainLoop *loop;

  GstElement *pipeline, *source, *conv, *sink;
  GstBus *bus;
  guint bus_watch_id;

  GstStateChangeReturn result;

  gst_init (&argc, &argv);

  loop = g_main_loop_new (NULL, FALSE);

  pipeline = gst_pipeline_new ("test");
  source   = gst_element_factory_make ("decklinkvideosrc", "source");
  conv     = gst_element_factory_make ("autovideoconvert",  "converter");
  sink     = gst_element_factory_make ("xvimagesink", "sink");

  if (!pipeline || !source || !conv || !sink) {
    g_printerr ("One element could not be created. Exiting.\n");
    return -1;
  }

//  gst_util_set_object_arg (G_OBJECT(source), "mode", "auto");
  gst_util_set_object_arg (G_OBJECT(source), "mode", "ntsc-p");
  gst_util_set_object_arg (G_OBJECT(source), "connection", "hdmi");

  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
  bus_watch_id = gst_bus_add_watch (bus, bus_call, loop);
  gst_object_unref (bus);

  gst_bin_add_many (GST_BIN (pipeline), source, conv, sink, NULL);
  gst_element_link_many (source, conv, sink, NULL);

  int delay = 2;
  g_print ("setting state: GST_STATE_PLAYING\n");
  result = gst_element_set_state (pipeline, GST_STATE_PLAYING);
  printStateChange(result);
  if(result == GST_STATE_CHANGE_ASYNC) {
    if(handleAsync(pipeline) == GST_STATE_CHANGE_FAILURE){
      return 0;
    }
  }

  g_print ("Returned, stopping playback\n");
  result = gst_element_set_state (pipeline, GST_STATE_NULL);
  printStateChange(result);
  if(result == GST_STATE_CHANGE_ASYNC) {
    if(handleAsync(pipeline) == GST_STATE_CHANGE_FAILURE){
      return 0;
    }
  }

  g_print ("Deleting pipeline\n");
  gst_object_unref (GST_OBJECT (pipeline));
  g_source_remove (bus_watch_id);
  g_main_loop_unref (loop);

  return 0;
}
Comment 1 GStreamer system administrator 2018-11-03 13:40:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/303.