gst_plugins_base/tsrc/check/elements/decodebin/src/decodebin.c
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    35 #include <gst/check/gstcheck.h>
    35 #include <gst/check/gstcheck.h>
    36 #include <unistd.h>
    36 #include <unistd.h>
    37 
    37 
    38 void create_xml(int result)
    38 void create_xml(int result)
    39 {
    39 {
    40 
       
    41     if(result)
    40     if(result)
    42     {
       
    43         assert_failed = 1;
    41         assert_failed = 1;
    44     } 
    42     
    45 
       
    46     testResultXml(xmlfile);
    43     testResultXml(xmlfile);
    47     close_log_file();
    44     close_log_file();
    48 
       
    49     if(result)
       
    50     {
       
    51         exit (-1);
       
    52     }    
       
    53 
       
    54 }
    45 }
    55 
    46 
    56 #if EMULATOR
    47 #if EMULATOR
    57 static GET_GLOBAL_VAR_FROM_TLS(threads_running,gstcheck,gboolean)
    48 static GET_GLOBAL_VAR_FROM_TLS(threads_running,gstcheck,gboolean)
    58 #define _gst_check_threads_running (*GET_GSTREAMER_WSD_VAR_NAME(threads_running,gstcheck,g)())
    49 #define _gst_check_threads_running (*GET_GSTREAMER_WSD_VAR_NAME(threads_running,gstcheck,g)())
    59 #else 
    50 #else 
    60 IMPORT_C extern gboolean _gst_check_threads_running;
    51 extern gboolean _gst_check_threads_running;
    61 #endif
    52 #endif
    62 #if EMULATOR
    53 #if EMULATOR
    63 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean)
    54 static GET_GLOBAL_VAR_FROM_TLS(raised_critical,gstcheck,gboolean)
    64 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)())
    55 #define _gst_check_raised_critical (*GET_GSTREAMER_WSD_VAR_NAME(raised_critical,gstcheck,g)())
    65 #else 
    56 #else 
    66 IMPORT_C extern gboolean _gst_check_raised_critical;
    57 extern gboolean _gst_check_raised_critical;
    67 #endif
    58 #endif
    68 //gboolean _gst_check_raised_warning = FALSE;
    59 //gboolean _gst_check_raised_warning = FALSE;
    69 #if EMULATOR
    60 #if EMULATOR
    70 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean)
    61 static GET_GLOBAL_VAR_FROM_TLS(raised_warning,gstcheck,gboolean)
    71 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)())
    62 #define _gst_check_raised_warning (*GET_GSTREAMER_WSD_VAR_NAME(raised_warning,gstcheck,g)())
    72 #else 
    63 #else 
    73 IMPORT_C extern gboolean _gst_check_raised_warning;
    64 extern gboolean _gst_check_raised_warning;
    74 #endif
    65 #endif
    75 //gboolean _gst_check_expecting_log = FALSE;
    66 //gboolean _gst_check_expecting_log = FALSE;
    76 #if EMULATOR
    67 #if EMULATOR
    77 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean)
    68 static GET_GLOBAL_VAR_FROM_TLS(expecting_log,gstcheck,gboolean)
    78 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)())
    69 #define _gst_check_expecting_log (*GET_GSTREAMER_WSD_VAR_NAME(expecting_log,gstcheck,g)())
    79 #else 
    70 #else 
    80 IMPORT_C extern gboolean _gst_check_expecting_log;
    71 extern gboolean _gst_check_expecting_log;
    81 #endif
    72 #endif
    82 
    73 
    83 #if EMULATOR
    74 #if EMULATOR
    84 GET_GLOBAL_VAR_FROM_TLS(buffers,gstcheck,GList*)
    75 GET_GLOBAL_VAR_FROM_TLS(buffers,gstcheck,GList*)
    85 #define buffers (*GET_GSTREAMER_WSD_VAR_NAME(buffers,gstcheck,g)())
    76 #define buffers (*GET_GSTREAMER_WSD_VAR_NAME(buffers,gstcheck,g)())
    86 #else 
    77 #else 
    87 IMPORT_C extern GList *buffers;
    78 extern GList *buffers;
    88 #endif
    79 #endif
    89 #if EMULATOR
    80 #if EMULATOR
    90 GET_GLOBAL_VAR_FROM_TLS(thread_list,gstcheck,GList*)
    81 GET_GLOBAL_VAR_FROM_TLS(thread_list,gstcheck,GList*)
    91 #define thread_list (*GET_GSTREAMER_WSD_VAR_NAME(thread_list,gstcheck,g)())
    82 #define thread_list (*GET_GSTREAMER_WSD_VAR_NAME(thread_list,gstcheck,g)())
    92 #else 
    83 #else 
    93 IMPORT_C extern GList *thread_list;
    84 extern GList *thread_list;
    94 #endif
    85 #endif
    95 
    86 
    96 //GMutex *mutex;
    87 //GMutex *mutex;
    97 #if EMULATOR
    88 #if EMULATOR
    98 GET_GLOBAL_VAR_FROM_TLS(mutex,gstcheck,GMutex*)
    89 GET_GLOBAL_VAR_FROM_TLS(mutex,gstcheck,GMutex*)
    99 #define mutex (*GET_GSTREAMER_WSD_VAR_NAME(mutex,gstcheck,g)())
    90 #define mutex (*GET_GSTREAMER_WSD_VAR_NAME(mutex,gstcheck,g)())
   100 #else 
    91 #else 
   101 IMPORT_C extern GMutex *mutex;
    92 extern GMutex *mutex=NULL;
   102 #endif
    93 #endif
   103 
    94 
   104 //GCond *start_cond;              /* used to notify main thread of thread startups */
    95 //GCond *start_cond;              /* used to notify main thread of thread startups */
   105 #if EMULATOR
    96 #if EMULATOR
   106 GET_GLOBAL_VAR_FROM_TLS(start_cond,gstcheck,GCond*)
    97 GET_GLOBAL_VAR_FROM_TLS(start_cond,gstcheck,GCond*)
   107 #define start_cond (*GET_GSTREAMER_WSD_VAR_NAME(start_cond,gstcheck,g)())
    98 #define start_cond (*GET_GSTREAMER_WSD_VAR_NAME(start_cond,gstcheck,g)())
   108 #else 
    99 #else 
   109 IMPORT_C extern GCond *start_cond;
   100 extern GCond *start_cond=NULL;
   110 #endif
   101 #endif
   111 
   102 
   112 //GCond *sync_cond;               /* used to synchronize all threads and main thread */
   103 //GCond *sync_cond;               /* used to synchronize all threads and main thread */
   113 #if EMULATOR
   104 #if EMULATOR
   114 GET_GLOBAL_VAR_FROM_TLS(sync_cond,gstcheck,GCond*)
   105 GET_GLOBAL_VAR_FROM_TLS(sync_cond,gstcheck,GCond*)
   115 #define sync_cond (*GET_GSTREAMER_WSD_VAR_NAME(sync_cond,gstcheck,g)())
   106 #define sync_cond (*GET_GSTREAMER_WSD_VAR_NAME(sync_cond,gstcheck,g)())
   116 #else 
   107 #else 
   117 IMPORT_C extern GCond *sync_cond;
   108 extern GCond *sync_cond=NULL;
   118 #endif
   109 #endif
   119 
   110 
   120 
   111 
   121 #if EMULATOR
   112 #if EMULATOR
   122 GET_GLOBAL_VAR_FROM_TLS(check_mutex,gstcheck,GMutex *)
   113 GET_GLOBAL_VAR_FROM_TLS(check_mutex,gstcheck,GMutex *)
   123 #define check_mutex (*GET_GSTREAMER_WSD_VAR_NAME(check_mutex,gstcheck,g)())
   114 #define check_mutex (*GET_GSTREAMER_WSD_VAR_NAME(check_mutex,gstcheck,g)())
   124 #else 
   115 #else 
   125 IMPORT_C extern GMutex *check_mutex;
   116 extern GMutex *check_mutex = NULL;
   126 #endif
   117 #endif
   127 //
   118 //
   128 //extern GCond *check_cond;
   119 //extern GCond *check_cond;
   129 #if EMULATOR
   120 #if EMULATOR
   130 GET_GLOBAL_VAR_FROM_TLS(check_cond,gstcheck,GCond *)
   121 GET_GLOBAL_VAR_FROM_TLS(check_cond,gstcheck,GCond *)
   131 #define check_cond (*GET_GSTREAMER_WSD_VAR_NAME(check_cond,gstcheck,g)())
   122 #define check_cond (*GET_GSTREAMER_WSD_VAR_NAME(check_cond,gstcheck,g)())
   132 #else 
   123 #else 
   133 IMPORT_C extern GCond *check_cond;
   124 extern GCond *check_cond = NULL;
   134 #endif
   125 #endif
   135 static const gchar dummytext[] =
   126 static const gchar dummytext[] =
   136     "Quick Brown Fox Jumps over a Lazy Frog Quick Brown "
   127     "Quick Brown Fox Jumps over a Lazy Frog Quick Brown "
   137     "Fox Jumps over a Lazy Frog Quick Brown Fox Jumps over a Lazy Frog Quick "
   128     "Fox Jumps over a Lazy Frog Quick Brown Fox Jumps over a Lazy Frog Quick "
   138     "Brown Fox Jumps over a Lazy Frog Quick Brown Fox Jumps over a Lazy Frog "
   129     "Brown Fox Jumps over a Lazy Frog Quick Brown Fox Jumps over a Lazy Frog "
   320 "test_reuse_without_decoders"
   311 "test_reuse_without_decoders"
   321 };
   312 };
   322 */
   313 */
   323 //GST_CHECK_MAIN (decodebin);
   314 //GST_CHECK_MAIN (decodebin);
   324 
   315 
   325 //int main (int argc, char **argv)
   316 int main (int argc, char **argv)
   326 //{
   317 {
   327 ////gst_init(&argc, &argv);                
   318 //gst_init(&argc, &argv);                
   328 //gst_check_init (NULL, NULL); 
   319 gst_check_init (NULL, NULL); 
   329 //test_text_plain_streams();
   320 test_text_plain_streams();
   330 //test_reuse_without_decoders();
   321 test_reuse_without_decoders();
   331 //
   322 
   332 //}
   323 }
   333 
       
   334 
       
   335 #if 1
       
   336 void (*fn[2]) (void) = {
       
   337         test_text_plain_streams,
       
   338         test_text_plain_streams
       
   339 };
       
   340 
       
   341 char *args[] = {
       
   342         "test_text_plain_streams",
       
   343         "test_text_plain_streams"
       
   344 };
       
   345 
       
   346 GST_CHECK_MAIN (filesrc);
       
   347 #endif