gstreamer_core/tsrc/examples/manual/elementfactory/src/elementfactory.c
changeset 2 5505e8908944
child 8 4a7fac7dd34a
equal deleted inserted replaced
1:4c282e7dd6d3 2:5505e8908944
       
     1 
       
     2 /*** block  from ../../../docs/manual/basics-elements.xml ***/
       
     3 
       
     4 #include <gst/gst_global.h>
       
     5 #include <gst/gst.h>
       
     6 #include <gst/check/gstcheck.h>
       
     7 
       
     8 #define LOG_FILE "c:\\logs\\elementfactory_logs.txt" 
       
     9 #include "std_log_result.h" 
       
    10 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    11 
       
    12 //char* xmlfile = "gstvalue";
       
    13 
       
    14 void create_xml(int result)
       
    15 {
       
    16     if(result)
       
    17         assert_failed = 1;
       
    18     
       
    19     testResultXml(xmlfile);
       
    20     close_log_file();
       
    21 }
       
    22 int
       
    23 main (int   argc,
       
    24       char *argv[])
       
    25 {
       
    26   GstElementFactory *factory;
       
    27   xmlfile = "elementfactory";
       
    28   std_log(LOG_FILENAME_LINE, "Test Started elementfactory");
       
    29 
       
    30   /* init GStreamer */
       
    31   gst_init (&argc, &argv);
       
    32 
       
    33   /* get factory */
       
    34   factory = gst_element_factory_find ("fakesrc");
       
    35   if (!factory) {
       
    36     g_print ("You don't have the 'fakesrc' element installed!\n");
       
    37     return -1;
       
    38   }
       
    39 
       
    40   /* display information */
       
    41   g_print ("The '%s' element is a member of the category %s.\n"
       
    42            "Description: %s\n",
       
    43            gst_plugin_feature_get_name (GST_PLUGIN_FEATURE (factory)),
       
    44            gst_element_factory_get_klass (factory),
       
    45            gst_element_factory_get_description (factory));
       
    46   std_log(LOG_FILENAME_LINE, "Test Successful");
       
    47   create_xml(0);         
       
    48   
       
    49   return 0;
       
    50 }