gstreamer_core/tsrc/examples/manual/makeelements/src/elementmake.c
changeset 0 0e761a78d257
equal deleted inserted replaced
-1:000000000000 0:0e761a78d257
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 /*** block  from ../../../docs/manual/basics-elements.xml ***/
       
    19 
       
    20 #include <gst/gst_global.h>
       
    21 #include <gst/gst.h>
       
    22 #include <stdio.h>
       
    23 #define LOG_FILE "c:\\logs\\makeelements_log1.txt"
       
    24 #include "std_log_result.h"
       
    25 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    26 
       
    27 //char* xmlfile = "filesink";
       
    28 
       
    29 
       
    30 void create_xml(int result)
       
    31 {
       
    32     if(result)
       
    33         assert_failed = 1;
       
    34     
       
    35     testResultXml(xmlfile);
       
    36     close_log_file();
       
    37 }
       
    38 int
       
    39 main (int   argc,
       
    40       char *argv[])
       
    41 {
       
    42   GstElement *element;
       
    43   xmlfile = "test_elementmake";
       
    44   std_log(LOG_FILENAME_LINE, "Test Started element make");
       
    45   /* init GStreamer */
       
    46   gst_init (&argc, &argv);
       
    47 
       
    48   /* create element */
       
    49   element = gst_element_factory_make ("fakesrc", "source");
       
    50   if (!element) {
       
    51     std_log(LOG_FILENAME_LINE, "Failed to create element of type 'fakesrc");
       
    52     g_print ("Failed to create element of type 'fakesrc'\n");
       
    53     return -1;
       
    54   }
       
    55 
       
    56   gst_object_unref (GST_OBJECT (element));
       
    57   std_log(LOG_FILENAME_LINE, "Test Successful");
       
    58   create_xml(0);
       
    59   return 0;
       
    60 }