コード例 #1
0
void setup_fxComponent(ILCLIENT_T *handle,
                       char *fxComponentName,
                       COMPONENT_T **fxComponent)
{
    int err;

    err = ilclient_create_component(handle,
                                    fxComponent,
                                    fxComponentName,
                                    ILCLIENT_DISABLE_ALL_PORTS |
                                        ILCLIENT_ENABLE_INPUT_BUFFERS |
                                        ILCLIENT_ENABLE_OUTPUT_BUFFERS);
    if (err == -1)
    {
        fprintf(stderr, "fxComponent create failed\n");
        exit(1);
    }
    printState(ilclient_get_handle(*fxComponent));

    err = ilclient_change_component_state(*fxComponent,
                                          OMX_StateIdle);
    if (err < 0)
    {
        fprintf(stderr, "Couldn't change state to Idle\n");
        exit(1);
    }
    printState(ilclient_get_handle(*fxComponent));

    // must be before we enable buffers
    setup_deinterlace(*fxComponent);
}
コード例 #2
0
ファイル: deinterlace.c プロジェクト: ted-n/gst-plugins-good
/* sets up a basic test pipeline containing:
 *
 * videotestsrc ! capsfilter ! deinterlace ! fakesink
 *
 * The parameters set the capsfilter caps and the num-buffers
 * property of videotestsrc
 *
 * It is useful for adding buffer probes to deinterlace pads
 * and validating inputs/outputs
 */
static void
setup_test_pipeline (gint mode, GstCaps * infiltercaps, GstCaps * outfiltercaps,
    gint numbuffers)
{
  GstElement *src;
  GstElement *infilter;
  GstElement *outfilter;
  GstElement *sink;

  setup_deinterlace ();

  pipeline = gst_pipeline_new ("pipeline");
  src = gst_element_factory_make ("videotestsrc", NULL);
  infilter = gst_element_factory_make ("capsfilter", "infilter");
  outfilter = gst_element_factory_make ("capsfilter", "outfilter");
  sink = gst_element_factory_make ("fakesink", NULL);
  fail_if (src == NULL);
  fail_if (infilter == NULL);
  fail_if (outfilter == NULL);
  fail_if (sink == NULL);

  fail_unless (gst_bin_add (GST_BIN (pipeline), src));
  fail_unless (gst_bin_add (GST_BIN (pipeline), infilter));
  fail_unless (gst_bin_add (GST_BIN (pipeline), deinterlace));
  fail_unless (gst_bin_add (GST_BIN (pipeline), outfilter));
  fail_unless (gst_bin_add (GST_BIN (pipeline), sink));

  /* set the properties */
  g_object_set (deinterlace, "mode", mode, NULL);
  if (numbuffers > 0)
    g_object_set (src, "num-buffers", numbuffers, NULL);
  if (infiltercaps)
    g_object_set (infilter, "caps", infiltercaps, NULL);
  if (outfiltercaps)
    g_object_set (outfilter, "caps", outfiltercaps, NULL);

  fail_unless (gst_element_link_many (src, infilter, deinterlace, outfilter,
          sink, NULL));
  if (infiltercaps)
    gst_caps_unref (infiltercaps);
  if (outfiltercaps)
    gst_caps_unref (outfiltercaps);
}