|
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\\getelements_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 #include <gst/gst.h> |
|
39 |
|
40 int main (int argc, |
|
41 char *argv[]) |
|
42 { |
|
43 GstElement *element; |
|
44 gchar *name; |
|
45 xmlfile = "test_elementget"; |
|
46 std_log(LOG_FILENAME_LINE, "Test Started element get"); |
|
47 /* init GStreamer */ |
|
48 gst_init (&argc, &argv); |
|
49 |
|
50 /* create element */ |
|
51 element = gst_element_factory_make ("filesrc", "source"); |
|
52 |
|
53 /* get name */ |
|
54 g_object_get (G_OBJECT (element), "name", &name, NULL); |
|
55 // g_print ("The name of the element is '%s'.\n", name); |
|
56 g_free (name); |
|
57 |
|
58 gst_object_unref (GST_OBJECT (element)); |
|
59 // getchar(); |
|
60 std_log(LOG_FILENAME_LINE, "Test Successful"); |
|
61 create_xml(0); |
|
62 return 0; |
|
63 } |