change property mode on decklinkvideosrc while playing

jeffanderson jeffrey.anderson at echostar.com
Mon Sep 21 11:23:56 PDT 2015


Should I be able to change the property mode of the decklinkvideosrc while
the pipeline is in GST_STATE_PLAYING?
I am able to change the value before adding the source element to the
pipeline when it is first created, but after I add it and start playing all
calls to gst_util_set_object_arg to set the mode to a different resolution
have no effect.  I have also tried modifying this property while the
pipeline is in the GST_STATE_PAUSED state.

I am using gst version 1.5.90, I build from source on 64-bit arch linux. I
have an Intensity Pro that does not support the auto mode.  Below is some
sample code I am using to test this.

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", "720p5994");
//  gst_util_set_object_arg (G_OBJECT(source), "mode", "ntsc");
  gst_util_set_object_arg (G_OBJECT(source), "mode", "1080i5994");
  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 = 3;
//begin test of toggling states
  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;
    }
  }

  sleep(delay);

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

  gst_util_set_object_arg (G_OBJECT(source), "mode", "720p5994");
  sleep(delay);

  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;
}
  



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/change-property-mode-on-decklinkvideosrc-while-playing-tp4673758.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list