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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>gstdataprotocol</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GStreamer 0.10 Library Reference Manual">
<link rel="up" href="gstreamer-dataprotocol.html" title="GStreamer Data Protocol">
<link rel="prev" href="gstreamer-dataprotocol.html" title="GStreamer Data Protocol">
<link rel="next" href="gstreamer-net.html" title="GStreamer Network Classes">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gstreamer-dataprotocol.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gstreamer-dataprotocol.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GStreamer 0.10 Library Reference Manual</th>
<td><a accesskey="n" href="gstreamer-net.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gstreamer-libs-gstdataprotocol.synopsis" class="shortcut">Top</a>
|
<a href="#gstreamer-libs-gstdataprotocol.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="gstdataprotocol">
<a name="gstreamer-libs-gstdataprotocol"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gstreamer-libs-gstdataprotocol.top_of_page"></a>gstdataprotocol</span></h2>
<p>gstdataprotocol — Serialization of caps, buffers and events.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gstreamer-libs-gstdataprotocol.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gst/dataprotocol/dataprotocol.h>
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag">GstDPHeaderFlag</a>;
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType">GstDPPayloadType</a>;
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-HEADER-LENGTH:CAPS" title="GST_DP_HEADER_LENGTH">GST_DP_HEADER_LENGTH</a>
enum <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion">GstDPVersion</a>;
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-VERSION-MAJOR:CAPS" title="GST_DP_VERSION_MAJOR">GST_DP_VERSION_MAJOR</a>
#define <a class="link" href="gstreamer-libs-gstdataprotocol.html#GST-DP-VERSION-MINOR:CAPS" title="GST_DP_VERSION_MINOR">GST_DP_VERSION_MINOR</a>
<span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-init" title="gst_dp_init ()">gst_dp_init</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFromBufferFunction" title="GstDPHeaderFromBufferFunction ()">*GstDPHeaderFromBufferFunction</a>) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketFromCapsFunction" title="GstDPPacketFromCapsFunction ()">*GstDPPacketFromCapsFunction</a>) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketFromEventFunction" title="GstDPPacketFromEventFunction ()">*GstDPPacketFromEventFunction</a>) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer">GstDPPacketizer</a>;
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="returnvalue">GstDPPacketizer</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packetizer-new" title="gst_dp_packetizer_new ()">gst_dp_packetizer_new</a> (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> version</code></em>);
<span class="returnvalue">void</span> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packetizer-free" title="gst_dp_packetizer_free ()">gst_dp_packetizer_free</a> (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> *packetizer</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-crc" title="gst_dp_crc ()">gst_dp_crc</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> length</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-header-payload-length" title="gst_dp_header_payload_length ()">gst_dp_header_payload_length</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="returnvalue">GstDPPayloadType</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-header-payload-type" title="gst_dp_header_payload_type ()">gst_dp_header_payload_type</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-header-from-buffer" title="gst_dp_header_from_buffer ()">gst_dp_header_from_buffer</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packet-from-caps" title="gst_dp_packet_from_caps ()">gst_dp_packet_from_caps</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-packet-from-event" title="gst_dp_packet_from_event ()">gst_dp_packet_from_event</a> (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-buffer-from-header" title="gst_dp_buffer_from_header ()">gst_dp_buffer_from_header</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-caps-from-packet" title="gst_dp_caps_from_packet ()">gst_dp_caps_from_packet</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="returnvalue">GstEvent</span></a> * <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-event-from-packet" title="gst_dp_event_from_packet ()">gst_dp_event_from_packet</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-header" title="gst_dp_validate_header ()">gst_dp_validate_header</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-payload" title="gst_dp_validate_payload ()">gst_dp_validate_payload</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()">gst_dp_validate_packet</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gstreamer-libs-gstdataprotocol.description"></a><h2>Description</h2>
<p>
This helper library provides serialization of GstBuffer, GstCaps and
GstEvent structures.
</p>
<p>
This serialization is useful when GStreamer needs to interface with
the outside world to transport data between distinct GStreamer pipelines.
The connections with the outside world generally don't have mechanisms
to transport properties of these structures.
</p>
<p>
For example, transporting buffers across named pipes or network connections
doesn't maintain the buffer size and separation.
</p>
<p>
This data protocol assumes a reliable connection-oriented transport, such as
TCP, a pipe, or a file. The protocol does not serialize the caps for
each buffer; instead, it transport the caps only when they change in the
stream. This implies that there will always be a caps packet before any
buffer packets.
</p>
<p>
The versioning of the protocol is independent of GStreamer's version.
The major number gets incremented, and the minor reset, for incompatible
changes. The minor number gets incremented for compatible changes that
allow clients who do not completely understand the newer protocol version
to still decode what they do understand.
</p>
<p>
Version 0.2 serializes only a small subset of all events, with a custom
payload for each type. Also, all GDP streams start with the initial caps
packet.
</p>
<p>
Version 1.0 serializes all events by taking the string representation of
the event as the payload. In addition, GDP streams can now start with
events as well, as required by the new data stream model in GStreamer 0.10.
</p>
<p>
Converting buffers, caps and events to GDP buffers is done using a
<a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> object and invoking its packetizer functions.
For backwards-compatibility reasons, the old 0.2 methods are still
available but deprecated.
</p>
<p>
For reference, this image shows the byte layout of the GDP header:
</p>
<p>
<img src="gdp-header.png">
</p>
</div>
<div class="refsect1" title="Details">
<a name="gstreamer-libs-gstdataprotocol.details"></a><h2>Details</h2>
<div class="refsect2" title="enum GstDPHeaderFlag">
<a name="GstDPHeaderFlag"></a><h3>enum GstDPHeaderFlag</h3>
<pre class="programlisting">typedef enum {
GST_DP_HEADER_FLAG_NONE = 0,
GST_DP_HEADER_FLAG_CRC_HEADER = (1 << 0),
GST_DP_HEADER_FLAG_CRC_PAYLOAD = (1 << 1),
GST_DP_HEADER_FLAG_CRC = (1 << 1) | (1 << 0),
} GstDPHeaderFlag;
</pre>
<p>
header flags for the dataprotocol.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_NONE</code></span></p></td>
<td>No flag present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC-HEADER:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC_HEADER</code></span></p></td>
<td>a header CRC field is present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC-PAYLOAD:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC_PAYLOAD</code></span></p></td>
<td>a payload CRC field is present.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-HEADER-FLAG-CRC:CAPS"></a><span class="term"><code class="literal">GST_DP_HEADER_FLAG_CRC</code></span></p></td>
<td>a CRC for header and payload is present.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum GstDPPayloadType">
<a name="GstDPPayloadType"></a><h3>enum GstDPPayloadType</h3>
<pre class="programlisting">typedef enum {
GST_DP_PAYLOAD_NONE = 0,
GST_DP_PAYLOAD_BUFFER,
GST_DP_PAYLOAD_CAPS,
GST_DP_PAYLOAD_EVENT_NONE = 64,
} GstDPPayloadType;
</pre>
<p>
The GDP payload types. a <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> payload type is encoded with the
event type number starting from <em class="parameter"><code>GST_DP_PAYLOAD_EVENT_NONE</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-PAYLOAD-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_NONE</code></span></p></td>
<td>Invalid payload type.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-BUFFER:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_BUFFER</code></span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> payload packet.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_CAPS</code></span></p></td>
<td>
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> payload packet.
</td>
</tr>
<tr>
<td><p><a name="GST-DP-PAYLOAD-EVENT-NONE:CAPS"></a><span class="term"><code class="literal">GST_DP_PAYLOAD_EVENT_NONE</code></span></p></td>
<td>First value of <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> payload packets.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GST_DP_HEADER_LENGTH">
<a name="GST-DP-HEADER-LENGTH:CAPS"></a><h3>GST_DP_HEADER_LENGTH</h3>
<pre class="programlisting">#define GST_DP_HEADER_LENGTH 62
</pre>
<p>
The header size in bytes.
</p>
</div>
<hr>
<div class="refsect2" title="enum GstDPVersion">
<a name="GstDPVersion"></a><h3>enum GstDPVersion</h3>
<pre class="programlisting">typedef enum {
GST_DP_VERSION_0_2 = 1,
GST_DP_VERSION_1_0,
} GstDPVersion;
</pre>
<p>
The version of the GDP protocol being used.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GST-DP-VERSION-0-2:CAPS"></a><span class="term"><code class="literal">GST_DP_VERSION_0_2</code></span></p></td>
<td>protocol version 0.2
</td>
</tr>
<tr>
<td><p><a name="GST-DP-VERSION-1-0:CAPS"></a><span class="term"><code class="literal">GST_DP_VERSION_1_0</code></span></p></td>
<td>protocol version 1.0
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GST_DP_VERSION_MAJOR">
<a name="GST-DP-VERSION-MAJOR:CAPS"></a><h3>GST_DP_VERSION_MAJOR</h3>
<pre class="programlisting">#define GST_DP_VERSION_MAJOR 0
</pre>
<p>
The major version number of the GStreamer Data Protocol.
</p>
</div>
<hr>
<div class="refsect2" title="GST_DP_VERSION_MINOR">
<a name="GST-DP-VERSION-MINOR:CAPS"></a><h3>GST_DP_VERSION_MINOR</h3>
<pre class="programlisting">#define GST_DP_VERSION_MINOR 2
</pre>
<p>
The minor version number of the GStreamer Data Protocol.
</p>
</div>
<hr>
<div class="refsect2" title="gst_dp_init ()">
<a name="gst-dp-init"></a><h3>gst_dp_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gst_dp_init (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Initialize GStreamer Data Protocol library.
</p>
<p>
Should be called before using these functions from source linking
to this source file.
</p>
</div>
<hr>
<div class="refsect2" title="GstDPHeaderFromBufferFunction ()">
<a name="GstDPHeaderFromBufferFunction"></a><h3>GstDPHeaderFromBufferFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPHeaderFromBufferFunction) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GstDPPacketFromCapsFunction ()">
<a name="GstDPPacketFromCapsFunction"></a><h3>GstDPPacketFromCapsFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPPacketFromCapsFunction) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>caps</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GstDPPacketFromEventFunction ()">
<a name="GstDPPacketFromEventFunction"></a><h3>GstDPPacketFromEventFunction ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> (*GstDPPacketFromEventFunction) (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GstDPPacketizer">
<a name="GstDPPacketizer"></a><h3>GstDPPacketizer</h3>
<pre class="programlisting">typedef struct {
GstDPVersion version;
GstDPHeaderFromBufferFunction header_from_buffer;
GstDPPacketFromCapsFunction packet_from_caps;
GstDPPacketFromEventFunction packet_from_event;
} GstDPPacketizer;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="gst_dp_packetizer_new ()">
<a name="gst-dp-packetizer-new"></a><h3>gst_dp_packetizer_new ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="returnvalue">GstDPPacketizer</span></a> * gst_dp_packetizer_new (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> version</code></em>);</pre>
<p>
Creates a new packetizer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>version</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPVersion" title="enum GstDPVersion"><span class="type">GstDPVersion</span></a> of the protocol to packetize for.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a newly allocated <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_packetizer_free ()">
<a name="gst-dp-packetizer-free"></a><h3>gst_dp_packetizer_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gst_dp_packetizer_free (<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> *packetizer</code></em>);</pre>
<p>
Free the given packetizer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>packetizer</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a> to free.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_crc ()">
<a name="gst-dp-crc"></a><h3>gst_dp_crc ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint16"><span class="returnvalue">guint16</span></a> gst_dp_crc (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *buffer</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> length</code></em>);</pre>
<p>
Calculate a CRC for the given buffer over the given number of bytes.
This is only provided for verification purposes; typical GDP users
will not need this function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>array of bytes
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>the length of <em class="parameter"><code>buffer</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a two-byte CRC checksum.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_header_payload_length ()">
<a name="gst-dp-header-payload-length"></a><h3>gst_dp_header_payload_length ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> gst_dp_header_payload_length (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Get the length of the payload described by <em class="parameter"><code>header</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte header of the packet array
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the length of the payload this header describes.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_header_payload_type ()">
<a name="gst-dp-header-payload-type"></a><h3>gst_dp_header_payload_type ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="returnvalue">GstDPPayloadType</span></a> gst_dp_header_payload_type (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Get the type of the payload described by <em class="parameter"><code>header</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte header of the packet array
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPayloadType" title="enum GstDPPayloadType"><span class="type">GstDPPayloadType</span></a> the payload this header describes.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_header_from_buffer ()">
<a name="gst-dp-header-from-buffer"></a><h3>gst_dp_header_from_buffer ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_header_from_buffer (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *buffer</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gst_dp_header_from_buffer</code> is deprecated and should not be used in newly-written code. use a <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a></p>
</div>
<p>
Creates a GDP header from the given buffer.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td>a <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> to create a header for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> to create the header with
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a guint pointer to store the header length in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>a guint8 * pointer to store a newly allocated header byte array in
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the header was successfully created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_packet_from_caps ()">
<a name="gst-dp-packet-from-caps"></a><h3>gst_dp_packet_from_caps ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_packet_from_caps (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gst_dp_packet_from_caps</code> is deprecated and should not be used in newly-written code. use a <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a></p>
</div>
<p>
Creates a GDP packet from the given caps.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>caps</code></em> :</span></p></td>
<td>a <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> to create a packet for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> to create the header with
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a guint pointer to store the header length in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>a guint8 pointer to store a newly allocated header byte array in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>a guint8 pointer to store a newly allocated payload byte array in
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the packet was successfully created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_packet_from_event ()">
<a name="gst-dp-packet-from-event"></a><h3>gst_dp_packet_from_event ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_packet_from_event (<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> *event</code></em>,
<em class="parameter"><code><a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> flags</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> *length</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **header</code></em>,
<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **payload</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gst_dp_packet_from_event</code> is deprecated and should not be used in newly-written code. use a <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPPacketizer" title="GstDPPacketizer"><span class="type">GstDPPacketizer</span></a></p>
</div>
<p>
Creates a GDP packet from the given event.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td>
<td>a <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> to create a packet for
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>the <a class="link" href="gstreamer-libs-gstdataprotocol.html#GstDPHeaderFlag" title="enum GstDPHeaderFlag"><span class="type">GstDPHeaderFlag</span></a> to create the header with
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>length</code></em> :</span></p></td>
<td>a guint pointer to store the header length in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>a guint8 pointer to store a newly allocated header byte array in
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>a guint8 pointer to store a newly allocated payload byte array in
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the packet was successfully created.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_buffer_from_header ()">
<a name="gst-dp-buffer-from-header"></a><h3>gst_dp_buffer_from_header ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="returnvalue">GstBuffer</span></a> * gst_dp_buffer_from_header (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Creates a newly allocated <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> from the given header.
The buffer data needs to be copied into it before validating.
</p>
<p>
Use this function if you want to pre-allocate a buffer based on the
packet header to read the packet payload in to.
</p>
<p>
This function does not check the header passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-header" title="gst_dp_validate_header ()"><code class="function">gst_dp_validate_header()</code></a> first if the header data is unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> if the buffer was successfully created, or NULL.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_caps_from_packet ()">
<a name="gst-dp-caps-from-packet"></a><h3>gst_dp_caps_from_packet ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="returnvalue">GstCaps</span></a> * gst_dp_caps_from_packet (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Creates a newly allocated <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> from the given packet.
</p>
<p>
This function does not check the arguments passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()"><code class="function">gst_dp_validate_packet()</code></a> first if the header and payload data are
unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> containing the caps represented in the packet,
or NULL if the packet could not be converted.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_event_from_packet ()">
<a name="gst-dp-event-from-packet"></a><h3>gst_dp_event_from_packet ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="returnvalue">GstEvent</span></a> * gst_dp_event_from_packet (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Creates a newly allocated <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> from the given packet.
</p>
<p>
This function does not check the arguments passed to it, use
<a class="link" href="gstreamer-libs-gstdataprotocol.html#gst-dp-validate-packet" title="gst_dp_validate_packet ()"><code class="function">gst_dp_validate_packet()</code></a> first if the header and payload data are
unchecked.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a> if the event was successfully created,
or NULL if an event could not be read from the payload.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_validate_header ()">
<a name="gst-dp-validate-header"></a><h3>gst_dp_validate_header ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_header (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>);</pre>
<p>
Validates the given packet header by checking the CRC checksum.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the CRC matches, or no CRC checksum is present.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_validate_payload ()">
<a name="gst-dp-validate-payload"></a><h3>gst_dp_validate_payload ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_payload (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Validates the given packet payload using the given packet header
by checking the CRC checksum.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the CRC matches, or no CRC checksum is present.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gst_dp_validate_packet ()">
<a name="gst-dp-validate-packet"></a><h3>gst_dp_validate_packet ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_dp_validate_packet (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> header_length</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *header</code></em>,
<em class="parameter"><code>const <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *payload</code></em>);</pre>
<p>
Validates the given packet by checking version information and checksums.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>header_length</code></em> :</span></p></td>
<td>the length of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>header</code></em> :</span></p></td>
<td>the byte array of the packet header
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>payload</code></em> :</span></p></td>
<td>the byte array of the packet payload
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the packet validates.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="gstreamer-libs-gstdataprotocol.see-also"></a><h2>See Also</h2>
<a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a>, <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstEvent.html#GstEvent"><span class="type">GstEvent</span></a>, <a href="/usr/share/gtk-doc/html/gstreamer-0.10/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.15</div>
</body>
</html>
|