gstreamer_core/tsrc/examples/manual/linkelements/src/elementlink.c
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:16:41 +0100
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201010 Kit: 201035


/*** block a  from ../../../docs/manual/basics-elements.xml ***/

#include <gst/gst_global.h>
#include <gst/gst.h>
#include <stdio.h>
#define LOG_FILE "c:\\logs\\linkelements_log1.txt"
#include "std_log_result.h"
#define LOG_FILENAME_LINE __FILE__, __LINE__

//char* xmlfile = "filesink";


void create_xml(int result)
{
    if(result)
        assert_failed = 1;
    
    testResultXml(xmlfile);
    close_log_file();
}
int
main (int   argc,
      char *argv[])
{
  GstElement *pipeline;
  GstElement *source, *filter, *sink;
  xmlfile = "test_elementlink";
  std_log(LOG_FILENAME_LINE, "Test Started element link");
  /* init */
  gst_init (&argc, &argv);

  /* create pipeline */
  pipeline = gst_pipeline_new ("my-pipeline");

  /* create elements */
  source = gst_element_factory_make ("fakesrc", "source");
  filter = gst_element_factory_make ("identity", "filter");
  sink = gst_element_factory_make ("fakesink", "sink");

  /* must add elements to pipeline before linking them */
  gst_bin_add_many (GST_BIN (pipeline), source, filter, sink, NULL);

  /* link */
  if (!gst_element_link_many (source, filter, sink, NULL)) {
    g_warning ("Failed to link elements!");
  }
  std_log(LOG_FILENAME_LINE, "Test Successful");
  create_xml(0);

/*** block b  from ../../../docs/manual/basics-elements.xml ***/
  return 0;

/*** block c  from ../../../docs/manual/basics-elements.xml ***/
}