/usr/include/gstreamermm-0.10/gstreamermm/pad.h is in libgstreamermm-0.10-dev 0.10.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 | // -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _GSTREAMERMM_PAD_H
#define _GSTREAMERMM_PAD_H
#include <glibmm.h>
/* gstreamermm - a C++ wrapper for gstreamer
*
* Copyright 2008 The gstreamermm Development Team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gst/gstpad.h>
#include <gstreamermm/object.h>
#include <gstreamermm/miniobject.h>
#include <gstreamermm/format.h>
#include <gstreamermm/query.h>
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GstPad GstPad;
typedef struct _GstPadClass GstPadClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{ class Pad_Class; } // namespace Gst
namespace Gst
{
class Buffer;
class Caps;
class Element;
class Event;
class PadTemplate;
class Query;
//Gst::Iterator<> forward declaration.
template <class CppType>
class Iterator;
/** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */
/**
* @ingroup gstreamermmEnums
*/
enum PadDirection
{
PAD_UNKNOWN,
PAD_SRC,
PAD_SINK
};
} // namespace Gst
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gst::PadDirection> : public Glib::Value_Enum<Gst::PadDirection>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{
/**
* @ingroup gstreamermmEnums
* @par Bitwise operators:
* <tt>%PadFlags operator|(PadFlags, PadFlags)</tt><br>
* <tt>%PadFlags operator&(PadFlags, PadFlags)</tt><br>
* <tt>%PadFlags operator^(PadFlags, PadFlags)</tt><br>
* <tt>%PadFlags operator~(PadFlags)</tt><br>
* <tt>%PadFlags& operator|=(PadFlags&, PadFlags)</tt><br>
* <tt>%PadFlags& operator&=(PadFlags&, PadFlags)</tt><br>
* <tt>%PadFlags& operator^=(PadFlags&, PadFlags)</tt><br>
*/
enum PadFlags
{
PAD_BLOCKED = 0x10,
PAD_FLUSHING = 0x20,
PAD_IN_GETCAPS = 0x40,
PAD_IN_SETCAPS = 0x80,
PAD_BLOCKING = 0x100,
PAD_FLAG_LAST = 0x1000
};
/** @ingroup gstreamermmEnums */
inline PadFlags operator|(PadFlags lhs, PadFlags rhs)
{ return static_cast<PadFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
/** @ingroup gstreamermmEnums */
inline PadFlags operator&(PadFlags lhs, PadFlags rhs)
{ return static_cast<PadFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
/** @ingroup gstreamermmEnums */
inline PadFlags operator^(PadFlags lhs, PadFlags rhs)
{ return static_cast<PadFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
/** @ingroup gstreamermmEnums */
inline PadFlags operator~(PadFlags flags)
{ return static_cast<PadFlags>(~static_cast<unsigned>(flags)); }
/** @ingroup gstreamermmEnums */
inline PadFlags& operator|=(PadFlags& lhs, PadFlags rhs)
{ return (lhs = static_cast<PadFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
/** @ingroup gstreamermmEnums */
inline PadFlags& operator&=(PadFlags& lhs, PadFlags rhs)
{ return (lhs = static_cast<PadFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
/** @ingroup gstreamermmEnums */
inline PadFlags& operator^=(PadFlags& lhs, PadFlags rhs)
{ return (lhs = static_cast<PadFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
} // namespace Gst
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gst::PadFlags> : public Glib::Value_Flags<Gst::PadFlags>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{
/**
* @ingroup gstreamermmEnums
*/
enum PadLinkReturn
{
PAD_LINK_OK = 0,
PAD_LINK_WRONG_HIERARCHY = -1,
PAD_LINK_WAS_LINKED = -2,
PAD_LINK_WRONG_DIRECTION = -3,
PAD_LINK_NOFORMAT = -4,
PAD_LINK_NOSCHED = -5,
PAD_LINK_REFUSED = -6
};
} // namespace Gst
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gst::PadLinkReturn> : public Glib::Value_Enum<Gst::PadLinkReturn>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{
/**
* @ingroup gstreamermmEnums
*/
enum FlowReturn
{
FLOW_CUSTOM_SUCCESS_2 = 102,
FLOW_CUSTOM_SUCCESS_1 = 101,
FLOW_CUSTOM_SUCCESS = 100,
FLOW_RESEND = 1,
FLOW_OK = 0,
FLOW_NOT_LINKED = -1,
FLOW_WRONG_STATE = -2,
FLOW_UNEXPECTED = -3,
FLOW_NOT_NEGOTIATED = -4,
FLOW_ERROR = -5,
FLOW_NOT_SUPPORTED = -6,
FLOW_CUSTOM_ERROR = -100,
FLOW_CUSTOM_ERROR_1 = -101,
FLOW_CUSTOM_ERROR_2 = -102
};
} // namespace Gst
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gst::FlowReturn> : public Glib::Value_Enum<Gst::FlowReturn>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{
/**
* @ingroup gstreamermmEnums
*/
enum ActivateMode
{
ACTIVATE_NONE,
ACTIVATE_PUSH,
ACTIVATE_PULL
};
} // namespace Gst
#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{
template <>
class Value<Gst::ActivateMode> : public Glib::Value_Enum<Gst::ActivateMode>
{
public:
static GType value_type() G_GNUC_CONST;
};
} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
namespace Gst
{
/** A class that represents objects contained by elements that allows links to
* other elements.
* A Gst::Element is linked to other elements via "pads", which are extremely
* light-weight generic link points. After two pads are retrieved from an
* element with Element::get_pad(), the pads can be link with link(). (For
* quick links, you can also use Element::link(), which will make the obvious
* link for you if it's straightforward.)
*
* Pads are typically created from a Gst::PadTemplate with the create() method
* that takes a Gst::PadTemplate.
*
* Pads have Gst::Caps attached to it to describe the media type they are
* capable of dealing with. get_caps() and set_caps() are used to manipulate
* the caps of the pads. Pads created from a pad template cannot set
* capabilities that are incompatible with the pad template capabilities.
*
* Pads without pad templates can be created with create(), which takes a
* direction and a name as an argument.
*
* get_parent_element() will retrieve the Gst::Element that owns the pad.
*
* A Gst::Element creating a pad will typically use the underlying C API to
* register callbacks for various events on the pads.
*
* Elements will use push() and pull_range() to push out or pull in a buffer.
*
* To send a Gst::Event on a pad, use send_event() and push_event().
*
* Last reviewed on 2006-07-06 (0.10.9)
*/
class Pad : public Object
{
#ifndef DOXYGEN_SHOULD_SKIP_THIS
public:
typedef Pad CppObjectType;
typedef Pad_Class CppClassType;
typedef GstPad BaseObjectType;
typedef GstPadClass BaseClassType;
private: friend class Pad_Class;
static CppClassType pad_class_;
private:
// noncopyable
Pad(const Pad&);
Pad& operator=(const Pad&);
protected:
explicit Pad(const Glib::ConstructParams& construct_params);
explicit Pad(GstPad* castitem);
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
public:
virtual ~Pad();
#ifndef DOXYGEN_SHOULD_SKIP_THIS
static GType get_type() G_GNUC_CONST;
static GType get_base_type() G_GNUC_CONST;
#endif
///Provides access to the underlying C GObject.
GstPad* gobj() { return reinterpret_cast<GstPad*>(gobject_); }
///Provides access to the underlying C GObject.
const GstPad* gobj() const { return reinterpret_cast<GstPad*>(gobject_); }
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
GstPad* gobj_copy();
private:
protected:
/** Constructs a Pad given a name and a direction.
* @param name The desired name of the pad.
* @param direction The desired direction of the pad.
*/
explicit Pad(const Glib::ustring& name, PadDirection direction);
/** Constructs a Pad given a direction without specifying a name. A unique
* name will be assigned to the pad.
* @param direction the direction of the pad.
*/
explicit Pad(PadDirection direction);
/** Constructs a Pad from a PadTemplate with the specified name.
* @param templ The PadTemplate.
* @param name The desired name of the pad.
* @throw std::runtime_error if construction fails.
*/
Pad(const Glib::RefPtr<const Gst::PadTemplate>& templ,
const Glib::ustring& name);
/** Constructs a Pad from a PadTemplate without specifying a name. A unique
* name will ge assigned to the pad.
* @param templ The PadTemplate.
* @throw std::runtime_error if construction fails.
*/
explicit Pad(const Glib::RefPtr<const Gst::PadTemplate>& templ);
public:
/** For example,
* void on_block(const Glib::RefPtr<Gst::Pad>& pad, bool blocked);.
*/
typedef sigc::slot<void, const Glib::RefPtr<Gst::Pad>&, bool> SlotBlock;
/** For example,
* bool on_have_data(const Glib::RefPtr<Gst::Pad>& pad, const
* Glib::RefPtr<Gst::MiniObjec>& data);.
* The data method should return true to keep the data in the pipeline, false
* to drop it (throw it away).
*/
typedef sigc::slot< bool, const Glib::RefPtr<Gst::Pad>&, const Glib::RefPtr<Gst::MiniObject>& > SlotData;
/** Creates a new pad with the given name in the given direction.
*
* @param name The name of the new pad.
* @param direction The GstPadDirection of the pad.
* @return A new Gst::Pad, or a null RefPtr<> in case of an error. MT safe.
*/
static Glib::RefPtr<Pad> create(const Glib::ustring& name, PadDirection dir);
/** Creates a new pad with a guaranteed unique name (across all pads) in the
* given direction.
*
* @param direction The GstPadDirection of the pad.
* @return A new Gst::Pad, or a null RefPtr<> in case of an error. MT safe.
*/
static Glib::RefPtr<Pad> create(PadDirection dir);
/** Creates a new pad with the given name from the given template.
*
* @param templ The pad template to use.
* @param name The name of the element.
* @return A new Gst::Pad, or a null RefPtr<> in case of an error.
* @throw std::runtime_error if construction fails.
*/
static Glib::RefPtr<Pad> create(const Glib::RefPtr<const Gst::PadTemplate>& pad_template);
/** Creates a new pad with a guaranteed unique name (across all pads) from
* the given template.
*
* @param templ The pad template to use.
* @return A new Gst::Pad, or a null RefPtr<> in case of an error.
* @throw std::runtime_error if construction fails.
*/
static Glib::RefPtr<Pad> create(const Glib::RefPtr<const Gst::PadTemplate>& pad_template, const Glib::ustring& name);
/** Gets the direction of the pad. The direction of the pad is
* decided at construction time so this function does not take
* the LOCK.
* @return The Gst::PadDirection of the pad.
*
* MT safe.
*/
PadDirection get_direction() const;
/** Gets the parent of @a pad, cast to a Gst::Element. If a @a pad has no parent or
* its parent is not an element, return <tt>0</tt>.
* @return The parent of the pad. The caller has a reference on the parent, so
* unref when you're finished with it.
*
* MT safe.
*/
Glib::RefPtr<Gst::Element> get_parent_element();
/** Gets the parent of @a pad, cast to a Gst::Element. If a @a pad has no parent or
* its parent is not an element, return <tt>0</tt>.
* @return The parent of the pad. The caller has a reference on the parent, so
* unref when you're finished with it.
*
* MT safe.
*/
Glib::RefPtr<const Gst::Element> get_parent_element() const;
/** Gets the template for @a pad.
* @return The Gst::PadTemplate from which this pad was instantiated, or <tt>0</tt>
* if this pad has no template.
*
* FIXME: currently returns an unrefcounted padtemplate.
*/
Glib::RefPtr<Gst::PadTemplate> get_pad_template();
/** Gets the template for @a pad.
* @return The Gst::PadTemplate from which this pad was instantiated, or <tt>0</tt>
* if this pad has no template.
*
* FIXME: currently returns an unrefcounted padtemplate.
*/
Glib::RefPtr<const Gst::PadTemplate> get_pad_template() const;
/** Links the source pad and the sink pad.
* @param sinkpad The sink Gst::Pad to link.
* @return A result code indicating if the connection worked or
* what went wrong.
*
* MT Safe.
*/
PadLinkReturn link(const Glib::RefPtr<Gst::Pad>& sink_pad);
/** Unlinks the source pad from the sink pad. Will emit the Gst::Pad::unlinked
* signal on both pads.
* @param sinkpad The sink Gst::Pad to unlink.
* @return <tt>true</tt> if the pads were unlinked. This function returns <tt>false</tt> if
* the pads were not linked together.
*
* MT safe.
*/
bool unlink(const Glib::RefPtr<Gst::Pad>& sink_pad);
/** Checks if a @a pad is linked to another pad or not.
* @return <tt>true</tt> if the pad is linked, <tt>false</tt> otherwise.
*
* MT safe.
*/
bool is_linked() const;
/** Checks if the source pad and the sink pad are compatible so they can be
* linked.
* @param sinkpad The sink Gst::Pad.
* @return <tt>true</tt> if the pads can be linked.
*/
bool can_link(const Glib::RefPtr<const Gst::Pad>& other_pad) const;
/** Gets the capabilities this pad can produce or consume.
* Note that this method doesn't necessarily return the caps set by
* set_caps() - use GST_PAD_CAPS() for that instead.
* gst_pad_get_caps returns all possible caps a pad can operate with, using
* the pad's get_caps function;
* this returns the pad template caps if not explicitly set.
* @return A newly allocated copy of the Gst::Caps of this pad.
*
* MT safe.
*/
Glib::RefPtr<Gst::Caps> get_caps();
/** Gets the capabilities this pad can produce or consume.
* Note that this method doesn't necessarily return the caps set by
* set_caps() - use GST_PAD_CAPS() for that instead.
* gst_pad_get_caps returns all possible caps a pad can operate with, using
* the pad's get_caps function;
* this returns the pad template caps if not explicitly set.
* @return A newly allocated copy of the Gst::Caps of this pad.
*
* MT safe.
*/
Glib::RefPtr<const Gst::Caps> get_caps() const;
/** Gets the capabilities of the allowed media types that can flow through
* @a pad and its peer.
*
* The allowed capabilities is calculated as the intersection of the results of
* calling get_caps() on @a pad and its peer. The caller owns a reference
* on the resulting caps.
* @return The allowed Gst::Caps of the pad link. Unref the caps when you no
* longer need it. This function returns <tt>0</tt> when @a pad has no peer.
*
* MT safe.
*/
Glib::RefPtr<Gst::Caps> get_allowed_caps();
/** Gets the capabilities of the allowed media types that can flow through
* @a pad and its peer.
*
* The allowed capabilities is calculated as the intersection of the results of
* calling get_caps() on @a pad and its peer. The caller owns a reference
* on the resulting caps.
* @return The allowed Gst::Caps of the pad link. Unref the caps when you no
* longer need it. This function returns <tt>0</tt> when @a pad has no peer.
*
* MT safe.
*/
Glib::RefPtr<const Gst::Caps> get_allowed_caps() const;
/** Gets the capabilities of the media type that currently flows through @a pad
* and its peer.
*
* This function can be used on both src and sinkpads. Note that srcpads are
* always negotiated before sinkpads so it is possible that the negotiated caps
* on the srcpad do not match the negotiated caps of the peer.
* @return The negotiated Gst::Caps of the pad link. Unref the caps when
* you no longer need it. This function returns <tt>0</tt> when the @a pad has no
* peer or is not negotiated yet.
*
* MT safe.
*/
Glib::RefPtr<Gst::Caps> get_negotiated_caps();
/** Gets the capabilities of the media type that currently flows through @a pad
* and its peer.
*
* This function can be used on both src and sinkpads. Note that srcpads are
* always negotiated before sinkpads so it is possible that the negotiated caps
* on the srcpad do not match the negotiated caps of the peer.
* @return The negotiated Gst::Caps of the pad link. Unref the caps when
* you no longer need it. This function returns <tt>0</tt> when the @a pad has no
* peer or is not negotiated yet.
*
* MT safe.
*/
Glib::RefPtr<const Gst::Caps> get_negotiated_caps() const;
//The documentation gst_pad_get_pad_template_caps() suggests that there shouldn't be a non-const return:
/** Gets the capabilities for pad's template.
*
* @return The Gst::Caps of this pad template.
*/
Glib::RefPtr<const Gst::Caps> get_pad_template_caps() const;
/** Sets the capabilities of this pad. The caps must be fixed. Any previous
* caps on the pad will be unreffed. This function refs the caps so you should
* unref if as soon as you don't need it anymore.
* It is possible to set <tt>0</tt> caps, which will make the pad unnegotiated
* again.
* @param caps A Gst::Caps to set.
* @return <tt>true</tt> if the caps could be set. <tt>false</tt> if the caps were not fixed
* or bad parameters were provided to this function.
*
* MT safe.
*/
bool set_caps(const Glib::RefPtr<Gst::Caps>& caps);
/** Gets the peer of @a pad. This function refs the peer pad so
* you need to unref it after use.
* @return The peer Gst::Pad. Unref after usage.
*
* MT safe.
*/
Glib::RefPtr<Gst::Pad> get_peer();
/** Gets the peer of @a pad. This function refs the peer pad so
* you need to unref it after use.
* @return The peer Gst::Pad. Unref after usage.
*
* MT safe.
*/
Glib::RefPtr<const Gst::Pad> get_peer() const;
/** Gets the capabilities of the peer connected to this pad. Similar to
* get_caps().
* @return A newly allocated copy of the Gst::Caps of the peer pad. Use
* gst_caps_unref() to get rid of it. This function returns <tt>0</tt> if there is
* no peer pad.
*/
Glib::RefPtr<Gst::Caps> peer_get_caps();
/** Gets the capabilities of the peer connected to this pad. Similar to
* get_caps().
* @return A newly allocated copy of the Gst::Caps of the peer pad. Use
* gst_caps_unref() to get rid of it. This function returns <tt>0</tt> if there is
* no peer pad.
*/
Glib::RefPtr<const Gst::Caps> peer_get_caps() const;
/** A helper function you can use that sets the
* @a gst_pad_get_fixed_caps_func as the getcaps function for the
* pad. This way the function will always return the negotiated caps
* or in case the pad is not negotiated, the padtemplate caps.
*
* Use this function on a pad that, once set_caps() has been called
* on it, cannot be renegotiated to something else.
*/
void use_fixed_caps();
/** Query if a pad is active
* @return <tt>true</tt> if the pad is active.
*
* MT safe.
*/
bool is_active() const;
/** Blocks or unblocks the dataflow on a pad. This function is
* a shortcut for set_blocked_async() with a <tt>0</tt>
* callback.
* @param blocked Boolean indicating we should block or unblock.
* @return <tt>true</tt> if the pad could be blocked. This function can fail if the
* wrong parameters were passed or the pad was already in the requested state.
*
* MT safe.
*/
bool set_blocked(bool blocked = true);
/** Blocks or unblocks the dataflow on a pad asynchronously. The provided
* slot is called when the operation succeeds; this happens right before the
* next attempt at pushing a buffer on the pad.
*
* This can take a while as the pad can only become blocked when real
* dataflow is happening. When the pipeline is stalled, for example in
* PAUSED, this can take an indeterminate amount of time. Be careful with
* this blocking call as it might not return for reasons stated above.
*
* @param slot SlotBlock that will be called when the operation succeeds.
* @param blocked boolean indicating whether the pad should be blocked or
* unblocked.
* @return true if the pad could be blocked. This function can fail if the
* pad was already in the requested state. MT safe.
*/
bool set_blocked_async(const SlotBlock& slot, bool blocked = true);
/** Checks if the pad is blocked or not. This function returns the
* last requested state of the pad. It is not certain that the pad
* is actually blocking at this point (see is_blocking()).
* @return <tt>true</tt> if the pad is blocked.
*
* MT safe.
*/
bool is_blocked() const;
/** Checks if the pad is blocking or not. This is a guaranteed state
* of whether the pad is actually blocking on a Gst::Buffer or a Gst::Event.
*
* @newin{0,10}.11
* @return <tt>true</tt> if the pad is blocking.
*
* MT safe.
*/
bool is_blocking() const;
/** Adds a "data probe" to a pad. The slot will be called whenever data
* passes through a pad. In this case data means both events and buffers. The
* probe will be called with the data as an argument. Note that the data will
* have a reference count greater than 1, so it will be immutable -- you must
* not change it.
*
* For source pads, the probe will be called after the blocking function, if
* any (see set_blocked_async()), but before looking up the peer to chain to.
* For sink pads, the probe function will be called before configuring the
* sink with new caps, if any, and before calling the pad's chain function.
*
* Your data probe should return true to let the data continue to flow, or
* false to drop it. Dropping data is rarely useful, but occasionally comes
* in handy with events.
*
* To remove a probe, use the appropriate function, such as
* remove_data_probe().
*
* @param slot The slot to call when data is passed over pad (note: slot is
* not copied because it is connected to a signal).
* @return The handler id which may be used to remove the connection later.
*/
gulong add_data_probe(const SlotData& slot);
/** Adds a probe that will be called for all buffers passing through a pad.
* See add_data_probe() for more information.
*
* @param slot The slot to call when buffers are passed over pad.
* @return The handler id.
*/
gulong add_buffer_probe(const SlotData& slot);
/** Adds a probe that will be called for all events passing through a pad.
* See add_data_probe() for more information.
*
* @param slot The slot to call when events are passed over pad.
* @return The handler id.
*/
gulong add_event_probe(const SlotData& slot);
/** Removes a data probe from @a pad.
* @param handler_id Handler id returned from gst_pad_add_data_probe.
*/
void remove_data_probe(guint handler_id);
/** Removes a buffer probe from @a pad.
* @param handler_id Handler id returned from gst_pad_add_buffer_probe.
*/
void remove_buffer_probe(guint handler_id);
/** Removes an event probe from @a pad.
* @param handler_id Handler id returned from gst_pad_add_event_probe.
*/
void remove_event_probe(guint handler_id);
//This is handwritten because conversion from Glib::RefPtr<Gst::Buffer>& to
//GstBuffer** is difficult.
/** Allocates a new, empty buffer optimized to push to pad pad. This function
* only works if pad is a source pad and has a peer.
*
* A new, empty Gst::Buffer will be put in the buf argument. You need to
* check the caps of the buffer after performing this function and
* renegotiate to the format if needed.
*
* @param offset The offset of the new buffer in the stream.
* @param size The size of the new buffer.
* @param caps The caps of the new buffer.
* @param buf An uninitialized Glib::RefPtr<> in which to store the new
* Gst::Buffer.
* @return A result code indicating success of the operation. Any result code
* other than Gst::FLOW_OK is an error and buf should not be used. An error
* can occur if the pad is not connected or when the downstream peer elements
* cannot provide an acceptable buffer. MT safe.
*/
FlowReturn alloc_buffer(guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buf);
//This is handwritten because conversion from Glib::RefPtr<Gst::Buffer>& to
//GstBuffer** is difficult.
/** In addition to the function alloc_buffer(), this function automatically
* calls set_caps() when the caps of the newly allocated buffer are different
* from the pad caps. Again, the pad must be a source pad.
*
* @param offset The offset of the new buffer in the stream.
* @param size The size of the new buffer.
* @param caps The caps of the new buffer.
* @param buf An uninitialized Glib::RefPtr<> in which to store the new
* Gst::Buffer.
* @return A result code indicating success of the operation. Any result code
* other than Gst::FLOW_OK is an error and buf should not be used. An error
* can occur if the pad is not connected or when the downstream peer elements
* cannot provide an acceptable buffer. MT safe.
*/
FlowReturn alloc_buffer_and_set_caps(guint64 offset, int size, const Glib::RefPtr<Gst::Caps>& caps, Glib::RefPtr<Gst::Buffer>& buf);
//This is handwritten because conversion from Glib::RefPtr<Gst::Buffer>& to
//GstBuffer** is difficult.
/** When pad is flushing this function returns Gst::FLOW_WRONG_STATE
* immediatly. Calls the getrange function of pad. If pad has no getrange
* function installed this function returns Gst::FLOW_NOT_SUPPORTED.
*
* This is a lowlevel function. Usually pull_range() is used. This function
* is designed to be used with a source pad only.
*
* @param offset The start offset of the buffer.
* @param size The length of the buffer.
* @param buffer An unitialized Glib::RefPtr<> in which to store the
* Gst::Buffer.
* @return A Gst::FlowReturn from the pad (Gst::FLOW_NOT_SUPPORTED if pad is
* not a source pad). MT safe.
*/
FlowReturn get_range(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer);
/** Check if the given pad accepts the caps.
* @param caps A Gst::Caps to check on the pad.
* @return <tt>true</tt> if the pad can accept the caps.
*/
bool accept_caps(const Glib::RefPtr<const Gst::Caps>& caps) const;
/** Calls get_allowed_caps() for every other pad belonging to the
* same element as @a pad, and returns the intersection of the results.
*
* This function is useful as a default getcaps function for an element
* that can handle any stream format, but requires all its pads to have
* the same caps. Two such elements are tee and adder.
* @return The intersection of the other pads' allowed caps.
*/
Glib::RefPtr<Gst::Caps> proxy_getcaps();
/** Calls get_allowed_caps() for every other pad belonging to the
* same element as @a pad, and returns the intersection of the results.
*
* This function is useful as a default getcaps function for an element
* that can handle any stream format, but requires all its pads to have
* the same caps. Two such elements are tee and adder.
* @return The intersection of the other pads' allowed caps.
*/
Glib::RefPtr<const Gst::Caps> proxy_getcaps() const;
/** Calls set_caps() for every other pad belonging to the
* same element as @a pad. If set_caps() fails on any pad,
* the proxy setcaps fails. May be used only during negotiation.
* @param caps The Gst::Caps to link with.
* @return <tt>true</tt> if sucessful.
*/
bool proxy_setcaps(const Glib::RefPtr<Gst::Caps>& caps);
/** Fixate a caps on the given pad. Modifies the caps in place, so you should
* make sure that the caps are actually writable (see gst_caps_make_writable()).
* @param caps The Gst::Caps to fixate.
*/
void fixate_caps(const Glib::RefPtr<Gst::Caps>& caps);
/** Check if the peer of @a pad accepts @a caps. If @a pad has no peer, this function
* returns <tt>true</tt>.
* @param caps A Gst::Caps to check on the pad.
* @return <tt>true</tt> if the peer of @a pad can accept the caps or @a pad has no peer.
*/
bool peer_accept_caps(const Glib::RefPtr<const Gst::Caps>& caps) const;
// This method is written manually because an extra ref is necessary
/** Pushes a buffer to the peer of the pad. The pad must be a source pad,
* otherwise this method returns Gst::FLOW_ERROR.
*
* This function will call an installed pad block before triggering any
* installed pad probes.
*
* If the caps on buffer are different from the currently configured caps on
* pad, this function will call any installed setcaps function on pad (see
* the C API gst_pad_set_setcaps_function()). In case of failure to
* renegotiate the new format, this function returns
* Gst::FLOW_NOT_NEGOTIATED.
*
* The function proceeds calling chain() on the peer pad and returns the
* value from that function. If pad has no peer, Gst::FLOW_NOT_LINKED will
* be returned.
*
* @param buffer The Gst::Buffer to push.
* @return A Gst::FlowReturn from the peer pad. MT safe.
*/
FlowReturn push(const Glib::RefPtr<Gst::Buffer>& buffer);
// This method is written manually because an extra ref is necessary
/** Sends the event to the peer of the pad. This function is mainly used by
* elements to send events to their peer elements.
*
* @param event The GstEvent to send to the pad.
* @return true if the event was handled. MT safe.
*/
bool push_event(const Glib::RefPtr<Gst::Event>& event);
/** Checks if a pull_range() can be performed on the peer
* source pad. This function is used by plugins that want to check
* if they can use random access on the peer source pad.
*
* The peer sourcepad can implement a custom Gst::PadCheckGetRangeFunction
* if it needs to perform some logic to determine if pull_range is
* possible.
* @return A <tt>bool</tt> with the result.
*
* MT safe.
*/
bool check_pull_range() const;
/** Pulls a buffer from the peer pad. This function will first trigger the
* pad block signal if it was installed. This method works only on sink
* pads.
*
* When pad is not linked Gst::FLOW_NOT_LINKED is returned else this function
* returns the result of get_range() on the peer pad.
*
* @a buffer's caps must either be unset or the same as what is already
* configured on pad. Renegotiation within a running pull-mode pipeline is
* not supported.
*
* @param offset The start offset of the buffer.
* @param size The length of the buffer.
* @param buffer An uninitialized Glib::RefPtr<> in which to hold the
* Gst::Buffer.
* @return A Gst::FlowReturn from the peer pad (Gst::FLOW_ERROR if pad is not
* a sink pad). When this function returns Gst::FLOW_OK, buffer will contain
* a valid Gst::Buffer. @a buffer may not be used when any other return value
* than Gst::FLOW_OK is returned. MT safe.
*/
FlowReturn pull_range(guint64 offset, guint size, Glib::RefPtr<Gst::Buffer>& buffer);
/** Activates or deactivates the given pad in pull mode via dispatching to the
* pad's activatepullfunc. For use from within pad activation functions only.
* When called on sink pads, will first proxy the call to the peer pad, which
* is expected to activate its internally linked pads from within its
* activate_pull function.
*
* If you don't know what this is, you probably don't want to call it.
* @param active Whether or not the pad should be active.
* @return <tt>true</tt> if the operation was successful.
*
* MT safe.
*/
bool activate_pull(bool active = true);
/** Activates or deactivates the given pad in push mode via dispatching to the
* pad's activatepushfunc. For use from within pad activation functions only.
*
* If you don't know what this is, you probably don't want to call it.
* @param active Whether the pad should be active or not.
* @return <tt>true</tt> if the operation was successful.
*
* MT safe.
*/
bool activate_push(bool active = true);
// This method is written manually because an extra ref is necessary
/** Sends the event to the pad. This function can be used by applications to
* send events in the pipeline.
*
* If the pad is a source pad, event should be an upstream event. If the pad
* is a sink pad, the event should be a downstream event. For example, you
* would not send a Gst::EVENT_EOS on a src pad; EOS events only propagate
* downstream. Furthermore, some downstream events have to be serialized
* with data flow, like EOS, while some can travel out-of-band, like
* Gst::EVENT_FLUSH_START. If the event needs to be serialized with data
* flow, this function will take the pad's stream lock while calling its
* event function.
*
* To find out whether an event type is upstream, downstream, or downstream
* and serialized, see Gst::EventTypeFlags, Gst::Enums::get_flags(),
* is_upstream(), Gst::Event::is_downstream(), and
* Gst::Event::is_serialized(). Note that in practice that an application or
* plugin doesn't need to bother itself with this information; the core
* handles all necessary locks and checks.
*
* @param event The Gst::Event to send to the pad.
* @return true if the event was handled.
*/
bool send_event(const Glib::RefPtr<Gst::Event>& event);
/** Invokes the default event handler for the given pad. End-of-stream and
* discontinuity events are handled specially, and then the event is sent to all
* pads internally linked to @a pad. Note that if there are many possible sink
* pads that are internally linked to @a pad, only one will be sent an event.
* Multi-sinkpad elements should implement custom event handlers.
* @param event The Gst::Event to handle.
* @return <tt>true</tt> if the event was sent succesfully.
*/
bool event_default(const Glib::RefPtr<Gst::Event>& event);
/** Dispatches a query to a pad. The query should have been allocated by the
* caller via one of the type-specific allocation functions in gstquery.h. The
* element is responsible for filling the query with an appropriate response,
* which should then be parsed with a type-specific query parsing function.
*
* Again, the caller is responsible for both the allocation and deallocation of
* the query structure.
* @param query The Gst::Query to perform.
* @return <tt>true</tt> if the query could be performed.
*/
bool query(const Glib::RefPtr<Gst::Query>& query) const;
/** Performs query() on the peer of @a pad.
*
* The caller is responsible for both the allocation and deallocation of
* the query structure.
*
* @newin{0,10}.15
* @param query The Gst::Query to perform.
* @return <tt>true</tt> if the query could be performed. This function returns <tt>false</tt>
* if @a pad has no peer.
*/
bool peer_query(const Glib::RefPtr<Gst::Query>& query) const;
/** Invokes the default query handler for the given pad.
* The query is sent to all pads internally linked to @a pad. Note that
* if there are many possible sink pads that are internally linked to
* @a pad, only one will be sent the query.
* Multi-sinkpad elements should implement custom query handlers.
* @param query The Gst::Query to handle.
* @return <tt>true</tt> if the query was performed succesfully.
*/
bool query_default(const Glib::RefPtr<Gst::Query>& query) const;
/** Queries a pad for the stream position.
* @param format A pointer to the Gst::Format asked for.
* On return contains the Gst::Format used.
* @param cur A location in which to store the current position, or <tt>0</tt>.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_position(Format& format, gint64& position) const;
/** Queries a pad for the stream position parsing only the format.
* @param format A reference to the Gst::Format asked for. On return contains
* the Gst::Format used.
* @return true if the query could be performed.
*/
bool query_position(Format& format) const;
/** Queries a pad for the total stream duration.
* @param format A pointer to the Gst::Format asked for.
* On return contains the Gst::Format used.
* @param duration A location in which to store the total duration, or <tt>0</tt>.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_duration(Format& format, gint64& duration) const;
/** Queries a pad for the total stream duration parsing only the format.
* @param format A reference to the Gst::Format asked for. On return contains
* the GstFormat used.
* @return true if the query could be performed.
*/
bool query_duration(Format& format) const;
/** Queries a pad to convert @a src_val in @a src_format to @a dest_format.
* @param src_format A Gst::Format to convert from.
* @param src_val A value to convert.
* @param dest_format A pointer to the Gst::Format to convert to.
* @param dest_val A pointer to the result.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const;
/** Queries the peer of a given sink pad for the stream position.
* @param format A pointer to the Gst::Format asked for.
* On return contains the Gst::Format used.
* @param cur A location in which to store the current position, or <tt>0</tt>.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_peer_position(Format& format, gint64& position) const;
/** Queries the peer of a given sink pad for the stream position parsing only
* the format.
* @param format A reference to the Gst::Format asked for. On return contains
* the Gst::Format used.
* @return true if the query could be performed.
*/
bool query_peer_position(Format& format) const;
/** Queries the peer pad of a given sink pad for the total stream duration.
* @param format A pointer to the Gst::Format asked for.
* On return contains the Gst::Format used.
* @param duration A location in which to store the total duration, or <tt>0</tt>.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_peer_duration(Format& format, gint64& duration) const;
/** Queries the peer pad of a given sink pad for the total stream duration.
* @param format A reference to the Gst::Format asked for. On return contains
* the Gst::Format used.
* @return true if the query could be performed.
*/
bool query_peer_duration(Format& format) const;
/** Queries the peer pad of a given sink pad to convert @a src_val in @a src_format
* to @a dest_format.
* @param src_format A Gst::Format to convert from.
* @param src_val A value to convert.
* @param dest_format A pointer to the Gst::Format to convert to.
* @param dest_val A pointer to the result.
* @return <tt>true</tt> if the query could be performed.
*/
bool query_peer_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const;
/** Get an array of supported queries that can be performed
* on this pad.
* @return A zero-terminated array of Gst::QueryType.
*/
Glib::ArrayHandle<QueryType> get_query_types() const;
/** Invoke the default dispatcher for the query types on
* the pad.
* @return An zero-terminated array of Gst::QueryType, or <tt>0</tt> if none of the
* internally-linked pads has a query types function.
*/
Glib::ArrayHandle<QueryType> get_query_types_default() const;
/** Gets an iterator for the pads to which the given pad is linked to inside
* of the parent element.
*
* Each Gst::Pad element yielded by the iterator will have its refcount increased,
* so unref after use.
*
* @newin{0,10}.21
* @return A new Gst::Iterator of Gst::Pad or <tt>0</tt> when the pad does not have an
* iterator function configured. Use gst_iterator_free() after usage.
*/
Gst::Iterator<Gst::Pad> iterate_internal_links();
/** Gets an iterator for the pads to which the given pad is linked to inside
* of the parent element.
*
* Each Gst::Pad element yielded by the iterator will have its refcount increased,
* so unref after use.
*
* @newin{0,10}.21
* @return A new Gst::Iterator of Gst::Pad or <tt>0</tt> when the pad does not have an
* iterator function configured. Use gst_iterator_free() after usage.
*/
Gst::Iterator<const Gst::Pad> iterate_internal_links() const;
/** Iterate the list of pads to which the given pad is linked to inside of
* the parent element.
* This is the default handler, and thus returns an iterator of all of the
* pads inside the parent element with opposite direction.
*
* The caller must free this iterator after use with gst_iterator_free().
*
* @newin{0,10}.21
* @return A Gst::Iterator of Gst::Pad, or <tt>0</tt> if @a pad has no parent. Unref each
* returned pad with Gst::Object::unref().
*/
Gst::Iterator<Gst::Pad> iterate_internal_links_default();
/** Iterate the list of pads to which the given pad is linked to inside of
* the parent element.
* This is the default handler, and thus returns an iterator of all of the
* pads inside the parent element with opposite direction.
*
* The caller must free this iterator after use with gst_iterator_free().
*
* @newin{0,10}.21
* @return A Gst::Iterator of Gst::Pad, or <tt>0</tt> if @a pad has no parent. Unref each
* returned pad with Gst::Object::unref().
*/
Gst::Iterator<const Gst::Pad> iterate_internal_links_default() const;
/** Gets a list of pads to which the given pad is linked to
* inside of the parent element.
* The caller must free this list after use.
*
* Not MT safe.
*
* Deprecated: This function does not ref the pads in the list so that they
* could become invalid by the time the application accesses them. It's also
* possible that the list changes while handling the pads, which the caller of
* this function is unable to know. Use the thread-safe
* iterate_internal_links() instead.
* @return A newly allocated List of pads, free with Glib::list_free().
*/
Glib::ListHandle< Glib::RefPtr<Gst::Pad> > get_internal_links();
/** Gets a list of pads to which the given pad is linked to
* inside of the parent element.
* The caller must free this list after use.
*
* Not MT safe.
*
* Deprecated: This function does not ref the pads in the list so that they
* could become invalid by the time the application accesses them. It's also
* possible that the list changes while handling the pads, which the caller of
* this function is unable to know. Use the thread-safe
* iterate_internal_links() instead.
* @return A newly allocated List of pads, free with Glib::list_free().
*/
Glib::ListHandle< Glib::RefPtr<const Gst::Pad> > get_internal_links() const;
/** Gets a list of pads to which the given pad is linked to
* inside of the parent element.
* This is the default handler, and thus returns a list of all of the
* pads inside the parent element with opposite direction.
*
* The caller must free this list after use with Glib::list_free().
*
* Deprecated: This function does not ref the pads in the list so that they
* could become invalid by the time the application accesses them. It's also
* possible that the list changes while handling the pads, which the caller of
* this function is unable to know. Use the thread-safe
* iterate_internal_links_default() instead.
* @return A newly allocated List of pads, or <tt>0</tt> if the pad has no parent.
*
* Not MT safe.
*/
Glib::ListHandle< Glib::RefPtr<Gst::Pad> > get_internal_links_default();
/** Gets a list of pads to which the given pad is linked to
* inside of the parent element.
* This is the default handler, and thus returns a list of all of the
* pads inside the parent element with opposite direction.
*
* The caller must free this list after use with Glib::list_free().
*
* Deprecated: This function does not ref the pads in the list so that they
* could become invalid by the time the application accesses them. It's also
* possible that the list changes while handling the pads, which the caller of
* this function is unable to know. Use the thread-safe
* iterate_internal_links_default() instead.
* @return A newly allocated List of pads, or <tt>0</tt> if the pad has no parent.
*
* Not MT safe.
*/
Glib::ListHandle< Glib::RefPtr<const Gst::Pad> > get_internal_links_default() const;
// This method is written manually because an extra ref is necessary
FlowReturn chain(const Glib::RefPtr<Gst::Buffer>& buffer);
/** Pause the task of @a pad. This function will also wait until the
* function executed by the task is finished if this function is not
* called from the task function.
* @return A <tt>true</tt> if the task could be paused or <tt>false</tt> when the pad
* has no task.
*/
bool pause_task() ;
/** Stop the task of @a pad. This function will also make sure that the
* function executed by the task will effectively stop if not called
* from the GstTaskFunction.
*
* This function will deadlock if called from the GstTaskFunction of
* the task. Use Gst::Task::pause() instead.
*
* Regardless of whether the pad has a task, the stream lock is acquired and
* released so as to ensure that streaming through this pad has finished.
* @return A <tt>true</tt> if the task could be stopped or <tt>false</tt> on error.
*/
bool stop_task() ;
/** Activates or deactivates the given pad.
* Normally called from within core state change functions.
*
* If @a active, makes sure the pad is active. If it is already active, either in
* push or pull mode, just return. Otherwise dispatches to the pad's activate
* function to perform the actual activation.
*
* If not @a active, checks the pad's current mode and calls
* activate_push() or activate_pull(), as appropriate, with a
* <tt>false</tt> argument.
* @param active Whether or not the pad should be active.
* @return #<tt>true</tt> if the operation was successful.
*
* MT safe.
*/
bool set_active(bool active = true);
//C API specific pad callback setting functions are ignored.
//C API helper function gst_pad_get_fixed_caps_func ignored.
//The "have-data" signal never really emits so ignore it. Adding data, event
//and buffer probes do emit.
/** Signals that a pad has been linked to the peer pad.
*
* @par Prototype:
* <tt>void on_my_%linked(const Glib::RefPtr<Gst::Pad>& peer_pad)</tt>
*/
Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& > signal_linked();
/** Signals that a pad connection has been requested.
*
* @par Prototype:
* <tt>void on_my_%request_link()</tt>
*/
Glib::SignalProxy0< void > signal_request_link();
/** Signals that a pad has been unlinked from the peer pad.
*
* @par Prototype:
* <tt>void on_my_%unlinked(const Glib::RefPtr<Gst::Pad>& peer_pad)</tt>
*/
Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Pad>& > signal_unlinked();
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The capabilities of the pad.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gst::Caps> > property_caps() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The direction of the pad.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<PadDirection> property_direction() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The GstPadTemplate of this pad.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy<PadTemplate> property_template() ;
#endif //#GLIBMM_PROPERTIES_ENABLED
#ifdef GLIBMM_PROPERTIES_ENABLED
/** The GstPadTemplate of this pad.
*
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
* the value of the property changes.
*/
Glib::PropertyProxy_ReadOnly<PadTemplate> property_template() const;
#endif //#GLIBMM_PROPERTIES_ENABLED
public:
public:
//C++ methods used to invoke GTK+ virtual functions:
protected:
//GTK+ Virtual Functions (override these to change behaviour):
//Default Signal Handlers::
virtual void on_linked(const Glib::RefPtr<Gst::Pad>& peer_pad);
virtual void on_request_link();
virtual void on_unlinked(const Glib::RefPtr<Gst::Pad>& peer_pad);
};
} // namespace Gst
namespace Glib
{
/** A Glib::wrap() method for this object.
*
* @param object The C instance.
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
* @result A C++ instance that wraps this C instance.
*
* @relates Gst::Pad
*/
Glib::RefPtr<Gst::Pad> wrap(GstPad* object, bool take_copy = false);
}
#endif /* _GSTREAMERMM_PAD_H */
|