Commit graph

66 commits

Author SHA1 Message Date
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Christoffer Stengren
de3b2cc171 gdpdepay: Query for buffer allocator before using default
https://bugzilla.gnome.org/show_bug.cgi?id=764361
2016-04-03 11:45:09 +03:00
Tim-Philipp Müller
62294f0650 gdppay: refactor payloading code a little
Get rid of some indirections and inefficiencies,
just payload things directly which gives us more
control over what memory is allocated where and
how and makes things much simpler. In particular,
we can now allocate the payload header plus the
GstMemory to represent it in one go.
2014-12-26 13:44:33 +00:00
Tim-Philipp Müller
c184a4bb04 gdppay: refactor a little
Get rid of now-useless packetizer struct and just
call internal functions directly. Also remove
version property which is now defunct, not least
because we create the packetizer with the
version in the init function before a version
can be set.
2014-12-26 13:44:32 +00:00
Tim-Philipp Müller
d790ba9a06 gdppay: optimise payloading of buffers with multiple memories
Add function to calculate a payload CRC across multiple memories
so we don't have to merge buffers with multiple memories just to
calculate the CRC. Also make CRC calculation function static,
since it's not used outside dataprotocol.h and move special-casing
of length = 0 -> CRC = 0 into CRC function (from caller).

Perhaps more importantly, since payload CRC is off by default:
don't map buffer (and possibly merge memories in the process)
if we are not going to use it to calculate a CRC anyway.
2014-12-26 13:44:32 +00:00
Tim-Philipp Müller
3853f8c070 gdppay: dataprotocol: drop bogus const
Doesn't really make sense given that we map
it and possibly merge memories and such.
2014-12-26 13:44:29 +00:00
Tim-Philipp Müller
c60f4ecd11 gdp: don't print already-freed string
CID 1221987
2014-06-09 10:10:01 +01:00
Olivier Crête
037f277566 gdp: Fail gracefully if event can't be parsed
https://bugzilla.gnome.org/show_bug.cgi?id=731093
2014-06-02 21:44:00 -04:00
Thiago Santos
6b0014b5ac gdp: add DTS to headers 2014-01-31 23:44:11 -03:00
Tim-Philipp Müller
e63027f198 gdp: actually log generic dataprotocol stuff to gdp category 2013-02-11 12:34:24 +00:00
Tim-Philipp Müller
9e1b75fda3 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-04 00:09:59 +00:00
Tim-Philipp Müller
2c5138dd76 gdp: dump bytes into debug log using GST_MEMDUMP
Instead of home-grown solution.
2012-09-11 01:54:46 +01:00
Wim Taymans
ed451b1cd7 update for new variable names 2012-09-11 01:54:46 +01:00
Wim Taymans
38abb4a497 update for memory api changes 2012-09-11 01:54:44 +01:00
Wim Taymans
66fb9166a4 dataprotocol: don't define default Category
Since we now include this into the unit tests directly, don't define the default
category macro because it conflicts with check.
2012-09-11 01:54:44 +01:00
Wim Taymans
f6cab316cc update for HEADER flag changes 2012-09-11 01:54:44 +01:00
Wim Taymans
33344dc2b9 port to new map API 2012-09-11 01:54:44 +01:00
Tim-Philipp Müller
2d7150414b gdp: move dataprotocol library into gdp plugin and make private
We have removed things like protocol=gdp in the tcp elements
in favour of explicit gdppay/depay elements, so there's no need
to keep a public API and library for now. We can still add it
back later. Someone needs to think hard about 0.11 and gdp
anyway one of these days.
2012-09-11 01:54:43 +01:00
Wim Taymans
3bd55502a1 gdp: rename buffer PREROLL -> LIVE flag
Rename the GST_BUFFER_FLAG_PREROLL to GST_BUFFER_FLAG_LIVE and give the new flag
a meaning. The old PREROLL flag never had a clear meaning.
2012-09-11 01:54:41 +01:00
Wim Taymans
615063ba5e gdp: make new _buffer_allocate method
Make a new method to allocate a buffer + memory that takes the allocator and the
alignment as parameters. Provide a macro for the old method but prefer to use
the new method to encourage plugins to negotiate the allocator properly.
2012-09-11 01:54:41 +01:00
Wim Taymans
1136224e91 gdp: Rework GstSegment handling
Improve GstSegment, rename some fields. The idea is to have the GstSegment
structure represent the timing structure of the buffers as they are generated by
the source or demuxer element.
gst_segment_set_seek() -> gst_segment_do_seek()
Rename the NEWSEGMENT event to SEGMENT.
Make parsing of the SEGMENT event into a GstSegment structure.
Pass a GstSegment structure when making a new SEGMENT event. This allows us to
pass the timing info directly to the next element. No accumulation is needed in
the receiving element, all the info is inside the element.
Remove gst_segment_set_newsegment(): This function as used to accumulate
segments received from upstream, which is now not needed anymore because the
segment event contains the complete timing information.
2012-09-11 01:54:41 +01:00
Wim Taymans
b4305c56f5 gdp: Hide the GstStructure in GstEvent
Hide the GstStructure of the event in the implementation specific part so that
we can change it.
Add methods to check and make the event writable.
Add a new method to get a writable GstStructure of the element.
Avoid directly accising the event structure.
2012-09-11 01:54:41 +01:00
Wim Taymans
7ec4633cef gdp: port code to new buffer data API 2012-09-11 01:54:41 +01:00
Wim Taymans
c25051cb01 gdp: remove deprecated code 2012-09-11 01:54:41 +01:00
Tim-Philipp Müller
2c9ac5a4c9 gdp: make public enum _get_type() functions thread-safe
Not that it is likely to matter in practice, but since these are public
API they should probably be thread-safe.
2012-09-11 01:54:40 +01:00
Tim-Philipp Müller
dbbbe59577 gdp: dataprotocol, lfocontrolsource: fix enum value name in enums that are public API
So run-time bindings can introspect the names correctly (we abuse this
field as description field only in elements, not for public API
(where the description belongs into the gtk-doc chunk).

https://bugzilla.gnome.org/show_bug.cgi?id=629946
2012-09-11 01:54:40 +01:00
Benjamin Otte
a7078b74fb gdp: Fixes for -Wmissing-declarations -Wmissing-prototypes
Also adds those flags to the configure warning flags

https://bugzilla.gnome.org/show_bug.cgi?id=611692
2012-09-11 01:54:39 +01:00
Stefan Kost
c1574cfbd1 gdp: fix broken xrefs in docs 2012-09-11 01:54:39 +01:00
Sebastian Dröge
1774354a3a gdp: Don't write to the same region of memory as a uint64 and uint16 as this breaks ...
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
Don't write to the same region of memory as a uint64 and uint16
as this breaks strict aliasing rules and apparantly breaks on PPC
and s390. Thanks to Sjoerd Simons for analysing. Fixes bug #348114.
2012-09-11 01:54:39 +01:00
Michael Smith
458f65fbba gdp: When calculating GDP body CRC, use the correct pointer.
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_packet_from_event_1_0):
When calculating GDP body CRC, use the correct pointer.
Fixes part of #522401.
2012-09-11 01:54:39 +01:00
Sebastian Dröge
90af674a5f gdp: Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* gst/gstconfig.h.in:
* libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer):
* libs/gst/check/gstcheck.c: (gst_check_log_message_func),
(gst_check_log_critical_func), (gst_check_drop_buffers),
(gst_check_element_push_buffer_list):
* libs/gst/controller/gstcontroller.c: (gst_controller_get),
(gst_controller_get_type):
* libs/gst/controller/gsthelper.c: (gst_object_control_properties),
(gst_object_get_controller), (gst_object_get_control_source):
* libs/gst/controller/gstinterpolationcontrolsource.c:
(gst_interpolation_control_source_new):
* libs/gst/controller/gstlfocontrolsource.c:
(gst_lfo_control_source_new):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_event_from_packet_0_2):
* plugins/elements/gstfdsrc.c:
* plugins/elements/gstmultiqueue.c:
* plugins/elements/gsttee.c:
* plugins/elements/gsttypefindelement.c:
* plugins/indexers/gstfileindex.c: (_file_index_id_save_xml),
(gst_file_index_add_association):
* plugins/indexers/gstmemindex.c:
* tests/benchmarks/gstpollstress.c: (mess_some_more):
* tests/check/elements/queue.c: (setup_queue):
* tests/check/gst/gstpipeline.c:
* tests/check/libs/collectpads.c: (setup), (teardown),
(gst_collect_pads_suite):
* tests/examples/adapter/adapter_test.c:
* tests/examples/metadata/read-metadata.c: (make_pipeline):
* tests/examples/xml/createxml.c:
* tests/examples/xml/runxml.c:
* tools/gst-inspect.c:
* tools/gst-run.c:
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers, not using variable sized arrays
on the stack, moving variable declarations to the beginning of
a block and using "foo (void)" instead of "foo ()" for declarations.
2012-09-11 01:54:39 +01:00
Tim-Philipp Müller
8941bdd4ee gdp: g_type_class_ref() other types as well, see #349410 and #64764.
Original commit message from CVS:
* gst/gst.c: (init_post):
* gst/gstevent.c: (_gst_event_initialize):
* gst/gstquery.c: (_gst_query_initialize):
* libs/gst/dataprotocol/dataprotocol.c (gst_dp_init):
g_type_class_ref() other types as well, see #349410 and #64764.
* gst/gstbuffer.c: (_gst_buffer_initialize):
* gst/gstmessage.c: (_gst_message_initialize):
Simplify existing g_type_class_ref().
2012-09-11 01:54:39 +01:00
Tim-Philipp Müller
328677c684 gdp: Printf fixes.
Original commit message from CVS:
* gst/gstpad.c: (pre_activate):
* gst/gstregistry.c: (gst_registry_scan_path_level):
* gst/gstregistryxml.c: (load_plugin):
* libs/gst/controller/gstcontroller.c:
(gst_controlled_property_set_interpolation_mode):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_packet_from_event_1_0):
* libs/gst/net/gstnetclientclock.c:
(gst_net_client_clock_observe_times):
* plugins/elements/gstfdsrc.c: (gst_fd_src_create):
Printf fixes.
2012-09-11 01:54:39 +01:00
Andy Wingo
a03185f5f2 gdp: GST_DISABLE_DEPRECATED is only for users of API that don't want to see deprecated functions in the headers; people th...
Original commit message from CVS:
2006-08-11  Andy Wingo  <wingo@pobox.com>

* configure.ac:
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packetizer_new):
* tests/check/libs/gdp.c: (gst_dp_suite): GST_DISABLE_DEPRECATED
is only for users of API that don't want to see deprecated
functions in the headers; people that want to compile out
deprecated code should pass -DGST_REMOVE_DEPRECATED into the
CFLAGS. Fixes the build of multifdsink, or will soon..
2012-09-11 01:54:39 +01:00
Stefan Kost
562a1bbdd6 gdp: add gst_object_{s,g}et_control_rate(), add private data section, fix docs
Original commit message from CVS:
* docs/libs/gstreamer-libs-sections.txt:
* libs/gst/controller/gstcontroller.c:
(_gst_controller_get_property), (_gst_controller_set_property),
(_gst_controller_init), (_gst_controller_class_init):
* libs/gst/controller/gstcontroller.h:
* libs/gst/controller/gsthelper.c: (gst_object_get_control_rate),
(gst_object_set_control_rate):
API: add gst_object_{s,g}et_control_rate(), add private data section,
fix docs
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packetizer_new):
* libs/gst/dataprotocol/dataprotocol.h:
add deprecation guards to make gtk-doc happy and allow disabling cruft
2012-09-11 01:54:38 +01:00
Wim Taymans
ae5528c28f gdp: Make debug category static
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer_any), (gst_dp_packet_from_caps_any),
(gst_dp_crc), (gst_dp_header_payload_length),
(gst_dp_header_payload_type), (gst_dp_packet_from_event),
(gst_dp_packet_from_event_1_0), (gst_dp_buffer_from_header),
(gst_dp_caps_from_packet), (gst_dp_event_from_packet_0_2),
(gst_dp_event_from_packet), (gst_dp_validate_header),
(gst_dp_validate_payload):
Make debug category static
Constify the crc table.
Do some more arg checking in public functions.
Fix some docs and do some small cleanups.
* tests/check/libs/gdp.c: (GST_START_TEST), (gst_dp_suite):
Add some more checks to see if GDP deals with bogus input.
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
93b60df9ac gdp: fix failure to deserialize event packets with empty payload (only ev...
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_event_from_packet_1_0):
Fixes #347337: failure to deserialize event packets with
empty payload (only event type)
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
499736b709 gdp: add a gdp image to the docs
Original commit message from CVS:

* docs/README:
* docs/images/gdp-header.svg:
add a gdp image
* docs/libs/Makefile.am:
* docs/libs/gdp-header.png:
* libs/gst/dataprotocol/dataprotocol.c:
add it to the API docs
* docs/manual/intro-motivation.xml:
fix typo
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
2c9aa80caa gdp: add note to docs about GDP versioning; remove tmpl file
Original commit message from CVS:
add note to docs about GDP versioning; remove tmpl file
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
84bbfbecc4 gdp: add a GstDPPacketizer object, and create/free functions
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer_any), (gst_dp_packet_from_caps_any),
(gst_dp_version_get_type), (gst_dp_init),
(gst_dp_header_from_buffer), (gst_dp_header_from_buffer_1_0),
(gst_dp_packet_from_caps), (gst_dp_packet_from_caps_1_0),
(gst_dp_packet_from_event), (gst_dp_packet_from_event_1_0),
(gst_dp_event_from_packet_0_2), (gst_dp_event_from_packet_1_0),
(gst_dp_event_from_packet), (gst_dp_packetizer_new),
(gst_dp_packetizer_free):
* libs/gst/dataprotocol/dataprotocol.h:
API: add a GstDPPacketizer object, and create/free functions
API: add GstDPVersion enum
Add 1.0 event function that uses the string serialization
Serialize more useful buffer flags
Fixes #343988
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
19ea4af5b3 gdp: factor out CRC code
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer), (gst_dp_packet_from_caps),
(gst_dp_packet_from_event):
factor out CRC code
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
10d21bc171 gdp: factor out some common header init code
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer), (gst_dp_packet_from_caps),
(gst_dp_packet_from_event):
factor out some common header init code
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
849da00210 gdp: make gst_dp_crc() public
Original commit message from CVS:

* docs/libs/gstreamer-libs-sections.txt:
* docs/libs/tmpl/gstdataprotocol.sgml:
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_crc):
* libs/gst/dataprotocol/dataprotocol.h:
API: make gst_dp_crc() public
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
25b5f08745 gdp: make sure we zero the whole ABI-compatible area
Original commit message from CVS:

* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
make sure we zero the whole ABI-compatible area
2012-09-11 01:54:38 +01:00
Thomas Vander Stichele
c1b82e3cda gdp: whitespace, comment, doc fixup
Original commit message from CVS:
whitespace, comment, doc fixup
2012-09-11 01:54:38 +01:00
Michael Smith
1c7fae3d5d gdp: Fixes in reading/writing events over GDP (not currently used?) - dereferencing ...
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Fixes in reading/writing events over GDP (not currently used?) -
dereferencing NULL events for unknown/invalid event types, memory
leak, and change g_warning to GST_WARNING.
2012-09-11 01:54:38 +01:00
Michael Smith
cfcef37b4f gdp: Fix docs for dataprocotol to not get the return types completely wrong for a fe...
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
Fix docs for dataprocotol to not get the return types completely
wrong for a few functions.
2012-09-11 01:54:38 +01:00
Wim Taymans
fc5ec74824 gdp: Documentation updates.
Original commit message from CVS:
* libs/gst/base/gstadapter.c:
* libs/gst/base/gstadapter.h:
* libs/gst/base/gstbasesink.c: (gst_base_sink_class_init),
(gst_base_sink_get_position):
* libs/gst/base/gstbasesink.h:
* libs/gst/base/gstbasesrc.c: (gst_base_src_class_init),
(gst_base_src_default_query), (gst_base_src_default_do_seek),
(gst_base_src_do_seek), (gst_base_src_perform_seek),
(gst_base_src_send_event), (gst_base_src_update_length),
(gst_base_src_get_range), (gst_base_src_loop),
(gst_base_src_start):
* libs/gst/base/gstbasesrc.h:
* libs/gst/base/gstbasetransform.h:
* libs/gst/base/gstcollectpads.h:
* libs/gst/base/gstpushsrc.c:
* libs/gst/base/gstpushsrc.h:
* libs/gst/dataprotocol/dataprotocol.c:
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/net/gstnetclientclock.h:
* libs/gst/net/gstnettimeprovider.h:
Documentation updates.
2012-09-11 01:54:38 +01:00
Andy Wingo
7e0a99936d gdp: Fix Timmeke Waymans bug.
Original commit message from CVS:
2005-10-13  Andy Wingo  <wingo@pobox.com>

* libs/gst/dataprotocol/dataprotocol.c (gst_dp_packet_from_caps):
Fix Timmeke Waymans bug.
(gst_dp_caps_from_packet): Make sure we pass a NUL-terminated
string of the proper length to gst_caps_from_string. There's a
potential for, before this fix, that this could cause someone
connecting over the network to cause a segfault if the payload is
not NUL-terminated.
2012-09-11 01:54:37 +01:00
Thomas Vander Stichele
4447f427d7 gdp: fix more valgrind warnings before turning up the heat
Original commit message from CVS:
fix more valgrind warnings before turning up the heat
2012-09-11 01:54:37 +01:00