Debian Codegraph @

gstreamer/gstreamermm/check.cc

raw symbols SCIP
1 /*
2 * check.cc
3 *
4 * Created on: 3 sie 2013
5 * Author: loganek
6 */
7
8 #include <gstreamermm/check.h>cxx . . $ `<file>/gstreamer/gstreamermm/check.h`/
9 #include <gstreamermm/elementfactory.h>cxx . . $ `<file>/gstreamer/gstreamermm/elementfactory.h`/
10 #include <algorithm>
11 #include <string>
12
13 using namespace Gst;
14 using Glibcxx . . $ Glib/::RefPtrcxx . . $ RefPtr#;
15 using Glibcxx . . $ Glib/::ustringcxx . . $ ustring#;
16
17 void ThrowIfcxx . . $ ThrowIf(b208cf973f54120a). (bool condition, const ustringcxx . . $ ustring#& message)
18 {
19 if (condition)
20 throw Exceptioncxx . . $ Gst/Exception# (message);
21 }
22
23 void ThrowIfNotcxx . . $ ThrowIfNot(b208cf973f54120a). (bool condition, const ustringcxx . . $ ustring#& message)
24 {
25 if (!condition)
26 throw Exceptioncxx . . $ Gst/Exception# (message);
27 }
28
29 template<typename T>
30 stdcxx . . $ std/::stringcxx . . $ std/string# ToStringcxx . . $ ToString(23b83986b497e4d5). (const T& obj)
31 {
32 #ifdef __GXX_EXPERIMENTAL_CXX0X__cxx . . $ `<built-in>:42:9`!
33 return stdcxx . . $ std/::to_stringcxx . . $ std/__cxx11/to_string(3d81e17e7a87eecc).(obj);
34 #else
35 std::ostringstream convert;
36 convert << obj;
37 return convert.str ();
38 #endif
39 }
40
41 template<typename T>
42 void CheckRefCountcxx . . $ CheckRefCount(cb3a697b77950c12). (T* object, const ustringcxx . . $ ustring#& name, int expected_refcount)
43 {
44 int refcount = GST_OBJECT_REFCOUNT_VALUEcxx . . $ `<external>/3075072394961518725/gstobject.h:91:9`! (object);
45
46 ThrowIfcxx . . $ ThrowIf(b208cf973f54120a). ((refcount == expected_refcount),
47 name +cxx . . $ Glib/operator+(6b0655b476210372). " refcount is " +cxx . . $ Glib/operator+(a085081755b563c5). ToStringcxx . . $ Glib/ustring#ustring(b484295947d76b8d).(refcount) +cxx . . $ Glib/operator+(6b0655b476210372).
48 " instead of " +cxx . . $ Glib/operator+(a085081755b563c5). ToStringcxx . . $ Glib/ustring#ustring(b484295947d76b8d).(expected_refcount));
49 }
50
51 RefPtrcxx . . $ RefPtr#<Elementcxx . . $ Gst/Element#> Checkcxx . . $ Gst/Check#::_Checkcxx . . $ Gst/Check#_Check#::setup_elementcxx . . $ Gst/Check#_Check#setup_element(1ef5e1ee31814ad5). (const ustringcxx . . $ ustring#& factory)
52 {
53 RefPtrcxx . . $ RefPtr#<Elementcxx . . $ Gst/Element#> elementcxx . . $ Glib/RefPtr#RefPtr(ced63f7c635d850d).;
54
55 element =cxx . . $ Glib/RefPtr#`operator=`(dc512bde7586264e). ElementFactorycxx . . $ Gst/ElementFactory#::create_elementcxx . . $ Gst/ElementFactory#create_element(bde311d80d2d00e5). (factory, factory);
56
57 ThrowIfcxx . . $ ThrowIf(b208cf973f54120a). (!!element, "Could not create a '" +cxx . . $ Glib/operator+(733d8bb4b557ea40). factory +cxx . . $ Glib/operator+(6b0655b476210372). "' element");
58 CheckRefCountcxx . . $ CheckRefCount(cb3a697b77950c12). (element->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).gobjcxx . . $ Gst/Element#gobj(f5e3ed92ee6596f1).(), factory, 1);
59
60 return elementcxx . . $ Glib/RefPtr#RefPtr(560c7fdd049cdfe1).;
61 }
62
63 void Checkcxx . . $ Gst/Check#::_Checkcxx . . $ Gst/Check#_Check#::caps_equalcxx . . $ Gst/Check#_Check#caps_equal(d84182866a238e18). (RefPtrcxx . . $ RefPtr#<Capscxx . . $ Gst/Caps#> caps1, RefPtrcxx . . $ RefPtr#<Capscxx . . $ Gst/Caps#> caps2)
64 {
65 ThrowIfcxx . . $ ThrowIf(b208cf973f54120a). (caps1->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).equalscxx . . $ Gst/Caps#equals(d9e03a89d073e5a7).(caps2cxx . . $ Glib/RefPtr#RefPtr(8440a00309d85a0).),
66 "caps ('" +cxx . . $ Glib/operator+(733d8bb4b557ea40). caps1->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).to_stringcxx . . $ Gst/Caps#to_string(fff0f585954e56f3).() +cxx . . $ Glib/operator+(6b0655b476210372). "') is"
67 " not equal to caps ('" +cxx . . $ Glib/operator+(a085081755b563c5). caps2->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).to_stringcxx . . $ Gst/Caps#to_string(fff0f585954e56f3).() +cxx . . $ Glib/operator+(6b0655b476210372). "')");
68 }
69
70 void buffer_datacxx . . $ buffer_data(d2e3076ea63d0ff0). (RefPtrcxx . . $ RefPtr#<Buffercxx . . $ Gst/Buffer#> buffer, gconstpointer data, gsize size)
71 {
72 MapInfocxx . . $ Gst/MapInfo# infocxx . . $ Gst/MapInfo#MapInfo(49f6e7a06ebc5aa8).;
73
74 ThrowIfNotcxx . . $ ThrowIfNot(b208cf973f54120a). (buffer->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).mapcxx . . $ Gst/Buffer#map(124242df5d0d5e99).(info, MAP_READcxx . . $ Gst/MAP_READ.), "Error occurs during mapping."cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).);
75 ThrowIfcxx . . $ ThrowIf(b208cf973f54120a). ((stdcxx . . $ std/::equalcxx . . $ std/equal(f82cc6ce9cd000ea). (info.get_datacxx . . $ Gst/MapInfo#get_data(37d8967d10cb1e7b).(), info.get_datacxx . . $ Gst/MapInfo#get_data(37d8967d10cb1e7b).() + size,
76 static_cast<const guint8*>(data)) != 0), "Buffer data not equals."cxx . . $ Glib/ustring#ustring(85c52e162fed56f9).);
77 // TODO: using gst_util to display/throw/return dump of memory
78
79 buffer->cxx . . $ Glib/RefPtr#`operator->`(34d6acfd341ba7ab).unmapcxx . . $ Gst/Buffer#unmap(f42c961c2eb148b0). (info);
80 }