gst_plugins_base/tsrc/check/elements/createelementbase/src/createelementbase.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 //createelementbase.c
       
    18 /*
       
    19  *  Copyright © 2005 Nokia Corporation.
       
    20  *  This material, including documentation and any related 
       
    21  *  computer progrs, is protected by copyright controlled by 
       
    22  *  Nokia Corporation. All rights are reserved. Copying, 
       
    23  *  including reproducing, storing, adapting or translating, any 
       
    24  *  or all of this material requires the prior written consent of 
       
    25  *  Nokia Corporation. This material also contains confidential 
       
    26  *  information which may not be disclosed to others without the 
       
    27  *  prior written consent of Nokia Corporation.
       
    28  * ============================================================================
       
    29  */
       
    30 
       
    31 
       
    32 #ifdef HAVE_CONFIG_H
       
    33 # include <config.h>
       
    34 #endif
       
    35 
       
    36 
       
    37 #include <gst/gst_global.h>
       
    38 #include <unistd.h>
       
    39 
       
    40 #define LOG_FILE "c:\\logs\\createelementbase_logs.txt" 
       
    41 #include "std_log_result.h" 
       
    42 #define LOG_FILENAME_LINE __FILE__, __LINE__
       
    43 
       
    44 void create_xml(int result)
       
    45 {
       
    46     if(result)
       
    47         assert_failed = 1;
       
    48     
       
    49     testResultXml(xmlfile);
       
    50     close_log_file();
       
    51 }
       
    52 #include <gst/check/gstcheck.h>
       
    53 #include "libgstreamer_wsd_solution.h" 
       
    54 
       
    55 #if EMULATOR
       
    56 GET_GLOBAL_VAR_FROM_TLS(buffers,gstcheck,GList*)
       
    57 #define buffers (*GET_GSTREAMER_WSD_VAR_NAME(buffers,gstcheck,g)())
       
    58 #else 
       
    59 extern GList *buffers;
       
    60 #endif
       
    61 
       
    62 
       
    63 #if EMULATOR
       
    64 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean)
       
    65 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)())
       
    66 #else 
       
    67 extern gboolean _gst_check_raised_critical ;
       
    68 #endif
       
    69 //gboolean _gst_check_raised_warning = FALSE;
       
    70 #if EMULATOR
       
    71 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean)
       
    72 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)())
       
    73 #else 
       
    74 extern gboolean _gst_check_raised_warning ;
       
    75 #endif
       
    76 //gboolean _gst_check_expecting_log = FALSE;
       
    77 #if EMULATOR
       
    78 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean)
       
    79 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)())
       
    80 #else 
       
    81 extern gboolean _gst_check_expecting_log ;
       
    82 #endif
       
    83 
       
    84 //gboolean _gst_check_expecting_log = FALSE;
       
    85 #if EMULATOR
       
    86 static GET_GLOBAL_VAR_FROM_TLS(threads_running,gstcheck,gboolean)
       
    87 #define _gst_check_threads_running (*GET_GSTREAMER_WSD_VAR_NAME(threads_running,gstcheck,g)())
       
    88 #else 
       
    89 extern gboolean _gst_check_threads_running ;
       
    90 #endif
       
    91 
       
    92 void test_createelement_base()
       
    93 {
       
    94   GstElement *adder,*capsfilter,*audiorate,*audioconvert,*typefind,*audioresample;
       
    95   GstElement *decodebin2,*queue2,*subparse,*gdpdepay,*volume,*gdppay;
       
    96   // xmlfile = "create_test_element";
       
    97     std_log(LOG_FILENAME_LINE, "Test Started element create base");
       
    98    
       
    99 adder       = gst_element_factory_make ("adder", "adder");
       
   100     fail_unless (adder != NULL, "Could not create adder");
       
   101  
       
   102 capsfilter  = gst_element_factory_make ("capsfilter", "capsfilter");
       
   103     fail_unless (capsfilter != NULL, "Could not create capsfilter");
       
   104 audiorate = gst_element_factory_make ("audiorate", "audiorate");
       
   105     fail_unless (audiorate  != NULL, "Could not create audiorate ");
       
   106 audioconvert    = gst_element_factory_make ("audioconvert", "audioconvert");
       
   107     fail_unless (audioconvert != NULL, "Could not create audioconvert");
       
   108 typefind    = gst_element_factory_make ("typefind", "typefind");
       
   109     fail_unless (typefind != NULL, "Could not create typefind");
       
   110 audioresample   = gst_element_factory_make ("audioresample", "audioresample");
       
   111     fail_unless (audioresample != NULL, "Could not create audioresample");
       
   112 decodebin2 = gst_element_factory_make ("decodebin2", "decodebin2");
       
   113     fail_unless (decodebin2 != NULL, "Could not create decodebin2");
       
   114 queue2 = gst_element_factory_make ("queue2","queue2");
       
   115     fail_unless (queue2 != NULL, "Could not create queue2");
       
   116 subparse    = gst_element_factory_make ("subparse", "subparse");
       
   117     fail_unless (subparse != NULL, "Could not create subparse");
       
   118 gdpdepay    = gst_element_factory_make ("gdpdepay", "gdpdepay");
       
   119     fail_unless (gdpdepay != NULL, "Could not create gdpdepay");
       
   120 gdppay      = gst_element_factory_make ("gdppay", "gdppay");
       
   121     fail_unless (gdppay != NULL, "Could not create gdppay");
       
   122 
       
   123   gst_object_unref (adder);
       
   124   gst_object_unref (capsfilter);
       
   125   gst_object_unref (audiorate);
       
   126   gst_object_unref (audioconvert);
       
   127   gst_object_unref (typefind);
       
   128   gst_object_unref (audioresample);
       
   129   gst_object_unref (decodebin2);
       
   130   gst_object_unref (queue2);
       
   131   gst_object_unref (subparse);
       
   132   gst_object_unref (gdpdepay);
       
   133   
       
   134   gst_object_unref (gdppay);
       
   135    std_log(LOG_FILENAME_LINE, "Test Successful");
       
   136    create_xml(0);
       
   137  
       
   138 }
       
   139 
       
   140 void (*fn[]) (void) = {
       
   141         test_createelement_base
       
   142 };
       
   143 
       
   144 char *args[] = {
       
   145         "test_createelement_base"
       
   146 };
       
   147 
       
   148 GST_CHECK_MAIN (createelementbase);