2006-05-10 16:34:06 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Thomas Vander Stichele <thomas at apestaart dot org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <unistd.h>
|
2006-05-10 18:16:23 +00:00
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#ifdef HAVE_FIONREAD_IN_SYS_FILIO
|
|
|
|
#include <sys/filio.h>
|
|
|
|
#endif
|
2006-05-10 16:34:06 +00:00
|
|
|
|
|
|
|
#include <gst/check/gstcheck.h>
|
|
|
|
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
|
|
|
static GstPad *mysrcpad;
|
2006-05-10 16:34:06 +00:00
|
|
|
|
|
|
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2006-06-02 16:26:54 +00:00
|
|
|
GST_STATIC_CAPS ("application/x-gst-check")
|
2006-05-10 16:34:06 +00:00
|
|
|
);
|
|
|
|
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
|
|
|
static GstElement *
|
|
|
|
setup_multifdsink (void)
|
2006-05-10 16:34:06 +00:00
|
|
|
{
|
|
|
|
GstElement *multifdsink;
|
|
|
|
|
|
|
|
GST_DEBUG ("setup_multifdsink");
|
|
|
|
multifdsink = gst_check_setup_element ("multifdsink");
|
|
|
|
mysrcpad = gst_check_setup_src_pad (multifdsink, &srctemplate, NULL);
|
|
|
|
|
|
|
|
return multifdsink;
|
|
|
|
}
|
|
|
|
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
|
|
|
static void
|
2006-05-10 16:34:06 +00:00
|
|
|
cleanup_multifdsink (GstElement * multifdsink)
|
|
|
|
{
|
|
|
|
GST_DEBUG ("cleanup_multifdsink");
|
|
|
|
|
|
|
|
gst_check_teardown_src_pad (multifdsink);
|
|
|
|
gst_check_teardown_element (multifdsink);
|
|
|
|
}
|
|
|
|
|
2006-05-10 18:16:23 +00:00
|
|
|
static void
|
|
|
|
wait_bytes_served (GstElement * sink, guint64 bytes)
|
|
|
|
{
|
|
|
|
guint64 bytes_served = 0;
|
|
|
|
|
|
|
|
while (bytes_served != bytes) {
|
|
|
|
g_object_get (sink, "bytes-served", &bytes_served, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-11 21:04:08 +00:00
|
|
|
/* FIXME: possibly racy, since if it would write, we may not get it
|
|
|
|
* immediately ? */
|
2006-05-11 21:20:20 +00:00
|
|
|
#define fail_if_can_read(msg,fd) \
|
2006-05-11 21:04:08 +00:00
|
|
|
G_STMT_START { \
|
|
|
|
long avail; \
|
|
|
|
\
|
|
|
|
fail_if (ioctl (fd, FIONREAD, &avail) < 0, "%s: could not ioctl", msg); \
|
|
|
|
fail_if (avail > 0, "%s: has bytes available to read"); \
|
|
|
|
} G_STMT_END;
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
|
2006-05-10 16:34:06 +00:00
|
|
|
GST_START_TEST (test_no_clients)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
2006-06-02 16:26:54 +00:00
|
|
|
GstCaps *caps;
|
2006-05-10 16:34:06 +00:00
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
2006-06-02 16:26:54 +00:00
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
2006-05-10 16:34:06 +00:00
|
|
|
buffer = gst_buffer_new_and_alloc (4);
|
2006-06-02 16:26:54 +00:00
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
gst_caps_unref (caps);
|
2006-05-10 16:34:06 +00:00
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-05-10 18:16:23 +00:00
|
|
|
GST_START_TEST (test_add_client)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
2006-06-02 16:26:54 +00:00
|
|
|
GstCaps *caps;
|
2006-05-10 18:16:23 +00:00
|
|
|
int pfd[2];
|
|
|
|
gchar data[4];
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
|
|
|
|
fail_if (pipe (pfd) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
/* add the client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd[1]);
|
|
|
|
|
2006-06-02 16:26:54 +00:00
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
|
2006-05-10 18:16:23 +00:00
|
|
|
buffer = gst_buffer_new_and_alloc (4);
|
2006-06-02 16:26:54 +00:00
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 2);
|
2006-05-10 18:16:23 +00:00
|
|
|
memcpy (GST_BUFFER_DATA (buffer), "dead", 4);
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
|
gst/tcp/gstmultifdsink.*: Added shiny new burst-on-connect methods.
Original commit message from CVS:
* gst/tcp/gstmultifdsink.c: (gst_sync_method_get_type),
(gst_unit_type_get_type), (gst_multi_fd_sink_class_init),
(gst_multi_fd_sink_init), (gst_multi_fd_sink_add_full),
(gst_multi_fd_sink_add), (gst_multi_fd_sink_handle_client_read),
(find_syncframe), (find_limits), (assign_value),
(count_burst_unit), (gst_multi_fd_sink_new_client),
(gst_multi_fd_sink_handle_client_write),
(gst_multi_fd_sink_queue_buffer), (gst_multi_fd_sink_render),
(gst_multi_fd_sink_set_property), (gst_multi_fd_sink_get_property),
(gst_multi_fd_sink_change_state):
* gst/tcp/gstmultifdsink.h:
Added shiny new burst-on-connect methods.
Add properties to control the minimal amount of data queued.
Small cleanups.
API: bytes-min property
API: time-min property
API: buffers-min property
API: burst-unit property
API: burst-value property
API: add-full signal
* gst/tcp/gsttcp-marshal.list:
Added new marshaller code for the new signal.
* tests/check/elements/multifdsink.c: (GST_START_TEST),
(multifdsink_suite):
Added testcases for new burst methods.
2006-06-19 17:12:57 +00:00
|
|
|
GST_DEBUG ("reading");
|
2006-05-10 18:16:23 +00:00
|
|
|
fail_if (read (pfd[0], data, 4) < 4);
|
|
|
|
fail_unless (strncmp (data, "dead", 4) == 0);
|
|
|
|
wait_bytes_served (sink, 4);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
2006-05-10 18:16:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-05-11 11:40:39 +00:00
|
|
|
#define fail_unless_read(msg,fd,size,ref) \
|
|
|
|
G_STMT_START { \
|
|
|
|
char data[size + 1]; \
|
|
|
|
int nbytes; \
|
|
|
|
\
|
|
|
|
GST_DEBUG ("%s: reading %d bytes", msg, size); \
|
|
|
|
nbytes = read (fd, data, size); \
|
|
|
|
data[size] = 0; \
|
|
|
|
GST_DEBUG ("%s: read %d bytes", msg, nbytes); \
|
|
|
|
fail_if (nbytes < size); \
|
|
|
|
fail_unless (memcmp (data, ref, size) == 0, \
|
|
|
|
"data read '%s' differs from '%s'", data, ref); \
|
|
|
|
} G_STMT_END;
|
|
|
|
|
|
|
|
/* from the given two data buffers, create two streamheader buffers and
|
|
|
|
* some caps that match it, and store them in the given pointers
|
2006-06-02 16:26:54 +00:00
|
|
|
* returns one ref to each of the buffers and the caps */
|
2006-05-10 18:16:23 +00:00
|
|
|
static void
|
2006-05-11 19:44:06 +00:00
|
|
|
gst_multifdsink_create_streamheader (const gchar * data1,
|
|
|
|
const gchar * data2, GstBuffer ** hbuf1, GstBuffer ** hbuf2,
|
|
|
|
GstCaps ** caps)
|
2006-05-10 18:16:23 +00:00
|
|
|
{
|
2006-06-02 16:26:54 +00:00
|
|
|
GstBuffer *buf;
|
2006-05-11 11:40:39 +00:00
|
|
|
GValue array = { 0 };
|
|
|
|
GValue value = { 0 };
|
|
|
|
GstStructure *structure;
|
|
|
|
guint size1 = strlen (data1);
|
|
|
|
guint size2 = strlen (data2);
|
|
|
|
|
|
|
|
fail_if (hbuf1 == NULL);
|
|
|
|
fail_if (hbuf2 == NULL);
|
|
|
|
fail_if (caps == NULL);
|
|
|
|
|
|
|
|
/* create caps with streamheader, set the caps, and push the IN_CAPS
|
|
|
|
* buffers */
|
|
|
|
*hbuf1 = gst_buffer_new_and_alloc (size1);
|
|
|
|
GST_BUFFER_FLAG_SET (*hbuf1, GST_BUFFER_FLAG_IN_CAPS);
|
|
|
|
memcpy (GST_BUFFER_DATA (*hbuf1), data1, size1);
|
|
|
|
*hbuf2 = gst_buffer_new_and_alloc (size2);
|
|
|
|
GST_BUFFER_FLAG_SET (*hbuf2, GST_BUFFER_FLAG_IN_CAPS);
|
|
|
|
memcpy (GST_BUFFER_DATA (*hbuf2), data2, size2);
|
|
|
|
|
|
|
|
g_value_init (&array, GST_TYPE_ARRAY);
|
|
|
|
|
|
|
|
g_value_init (&value, GST_TYPE_BUFFER);
|
2006-06-02 16:26:54 +00:00
|
|
|
/* we take a copy, set it on the array (which refs it), then unref our copy */
|
|
|
|
buf = gst_buffer_copy (*hbuf1);
|
|
|
|
gst_value_set_buffer (&value, buf);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (buf, "copied buffer", 2);
|
|
|
|
gst_buffer_unref (buf);
|
2006-05-11 11:40:39 +00:00
|
|
|
gst_value_array_append_value (&array, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
g_value_init (&value, GST_TYPE_BUFFER);
|
2006-06-02 16:26:54 +00:00
|
|
|
buf = gst_buffer_copy (*hbuf2);
|
|
|
|
gst_value_set_buffer (&value, buf);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (buf, "copied buffer", 2);
|
|
|
|
gst_buffer_unref (buf);
|
2006-05-11 11:40:39 +00:00
|
|
|
gst_value_array_append_value (&array, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
|
|
|
|
*caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
structure = gst_caps_get_structure (*caps, 0);
|
|
|
|
|
|
|
|
gst_structure_set_value (structure, "streamheader", &array);
|
|
|
|
g_value_unset (&array);
|
2006-06-02 16:26:54 +00:00
|
|
|
ASSERT_CAPS_REFCOUNT (*caps, "streamheader caps", 1);
|
|
|
|
|
|
|
|
/* set our streamheadery caps on the buffers */
|
|
|
|
gst_buffer_set_caps (*hbuf1, *caps);
|
|
|
|
gst_buffer_set_caps (*hbuf2, *caps);
|
|
|
|
ASSERT_CAPS_REFCOUNT (*caps, "streamheader caps", 3);
|
|
|
|
|
2010-03-11 11:18:00 +00:00
|
|
|
/* we want to keep them around for the tests */
|
|
|
|
gst_buffer_ref (*hbuf1);
|
|
|
|
gst_buffer_ref (*hbuf2);
|
|
|
|
|
2006-06-02 16:26:54 +00:00
|
|
|
GST_DEBUG ("created streamheader caps %p %" GST_PTR_FORMAT, *caps, *caps);
|
2006-05-10 18:16:23 +00:00
|
|
|
}
|
|
|
|
|
2006-05-11 11:40:39 +00:00
|
|
|
|
2006-05-10 18:16:23 +00:00
|
|
|
/* this test:
|
|
|
|
* - adds a first client
|
|
|
|
* - sets streamheader caps on the pad
|
|
|
|
* - pushes the IN_CAPS buffers
|
|
|
|
* - pushes a buffer
|
2006-06-02 16:26:54 +00:00
|
|
|
* - verifies that the client received all the data correctly, and did not
|
|
|
|
* get multiple copies of the streamheader
|
2006-05-10 18:16:23 +00:00
|
|
|
* - adds a second client
|
2006-05-11 11:40:39 +00:00
|
|
|
* - verifies that this second client receives the streamheader caps too, plus
|
|
|
|
* - the new buffer
|
2006-05-10 18:16:23 +00:00
|
|
|
*/
|
|
|
|
GST_START_TEST (test_streamheader)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *hbuf1, *hbuf2, *buf;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2], pfd2[2];
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
fail_if (pipe (pfd2) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
/* add the first client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
|
|
|
|
/* create caps with streamheader, set the caps, and push the IN_CAPS
|
|
|
|
* buffers */
|
2006-05-11 11:40:39 +00:00
|
|
|
gst_multifdsink_create_streamheader ("babe", "deadbeef", &hbuf1, &hbuf2,
|
|
|
|
&caps);
|
2006-05-10 18:31:27 +00:00
|
|
|
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
2006-06-02 16:26:54 +00:00
|
|
|
/* one is ours, two on the buffers, and one now on the pad */
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 4);
|
2006-05-10 18:16:23 +00:00
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf1) == GST_FLOW_OK);
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf2) == GST_FLOW_OK);
|
|
|
|
|
2006-05-11 21:35:44 +00:00
|
|
|
//FIXME:
|
|
|
|
//fail_if_can_read ("first client", pfd1[0]);
|
2006-05-10 18:16:23 +00:00
|
|
|
|
|
|
|
/* push a non-IN_CAPS buffer, this should trigger the client receiving the
|
|
|
|
* first three buffers */
|
|
|
|
buf = gst_buffer_new_and_alloc (4);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), "f00d", 4);
|
|
|
|
gst_pad_push (mysrcpad, buf);
|
|
|
|
|
|
|
|
fail_unless_read ("first client", pfd1[0], 4, "babe");
|
|
|
|
fail_unless_read ("first client", pfd1[0], 8, "deadbeef");
|
|
|
|
fail_unless_read ("first client", pfd1[0], 4, "f00d");
|
|
|
|
wait_bytes_served (sink, 16);
|
|
|
|
|
|
|
|
/* now add the second client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd2[1]);
|
2006-05-11 21:47:01 +00:00
|
|
|
//FIXME:
|
|
|
|
//fail_if_can_read ("second client", pfd2[0]);
|
2006-05-10 18:16:23 +00:00
|
|
|
|
|
|
|
/* now push another buffer, which will trigger streamheader for second
|
|
|
|
* client */
|
|
|
|
buf = gst_buffer_new_and_alloc (4);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), "deaf", 4);
|
|
|
|
gst_pad_push (mysrcpad, buf);
|
|
|
|
|
|
|
|
fail_unless_read ("first client", pfd1[0], 4, "deaf");
|
|
|
|
|
|
|
|
fail_unless_read ("second client", pfd2[0], 4, "babe");
|
|
|
|
fail_unless_read ("second client", pfd2[0], 8, "deadbeef");
|
|
|
|
/* we missed the f00d buffer */
|
|
|
|
fail_unless_read ("second client", pfd2[0], 4, "deaf");
|
|
|
|
wait_bytes_served (sink, 36);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
g_signal_emit_by_name (sink, "remove", pfd1[1]);
|
|
|
|
g_signal_emit_by_name (sink, "remove", pfd2[1]);
|
|
|
|
|
2006-05-10 18:16:23 +00:00
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 1);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 1);
|
|
|
|
gst_buffer_unref (hbuf1);
|
|
|
|
gst_buffer_unref (hbuf2);
|
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
2006-05-10 18:16:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-05-11 11:40:39 +00:00
|
|
|
/* this tests changing of streamheaders
|
|
|
|
* - set streamheader caps on the pad
|
|
|
|
* - pushes the IN_CAPS buffers
|
|
|
|
* - pushes a buffer
|
|
|
|
* - add a first client
|
|
|
|
* - verifies that this first client receives the first streamheader caps,
|
|
|
|
* plus a new buffer
|
|
|
|
* - change streamheader caps
|
|
|
|
* - verify that the first client receives the new streamheader buffers as well
|
|
|
|
*/
|
|
|
|
GST_START_TEST (test_change_streamheader)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *hbuf1, *hbuf2, *buf;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2], pfd2[2];
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
fail_if (pipe (pfd2) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
/* create caps with streamheader, set the caps, and push the IN_CAPS
|
|
|
|
* buffers */
|
2006-06-02 16:26:54 +00:00
|
|
|
gst_multifdsink_create_streamheader ("first", "header", &hbuf1, &hbuf2,
|
2006-05-11 11:40:39 +00:00
|
|
|
&caps);
|
|
|
|
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
2006-06-02 16:26:54 +00:00
|
|
|
/* one is ours, two on the buffers, and one now on the pad */
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 4);
|
|
|
|
|
|
|
|
/* one to hold for the test and one to give away */
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf1) == GST_FLOW_OK);
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf2) == GST_FLOW_OK);
|
|
|
|
|
|
|
|
/* add the first client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
|
|
|
|
/* verify this hasn't triggered a write yet */
|
|
|
|
/* FIXME: possibly racy, since if it would write, we may not get it
|
|
|
|
* immediately ? */
|
2006-06-02 16:35:12 +00:00
|
|
|
//fail_if_can_read ("first client, no buffer", pfd1[0]);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
/* now push a buffer and read */
|
|
|
|
buf = gst_buffer_new_and_alloc (4);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), "f00d", 4);
|
|
|
|
gst_pad_push (mysrcpad, buf);
|
|
|
|
|
2006-06-02 16:26:54 +00:00
|
|
|
fail_unless_read ("change: first client", pfd1[0], 5, "first");
|
|
|
|
fail_unless_read ("change: first client", pfd1[0], 6, "header");
|
2006-05-11 11:40:39 +00:00
|
|
|
fail_unless_read ("change: first client", pfd1[0], 4, "f00d");
|
2006-06-02 16:26:54 +00:00
|
|
|
//wait_bytes_served (sink, 16);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
/* now add the second client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd2[1]);
|
2006-06-02 16:35:12 +00:00
|
|
|
//fail_if_can_read ("second client, no buffer", pfd2[0]);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
/* change the streamheader */
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
/* before we change, multifdsink still has a list of the old streamheaders */
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
|
2006-05-11 11:40:39 +00:00
|
|
|
gst_buffer_unref (hbuf1);
|
|
|
|
gst_buffer_unref (hbuf2);
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
/* drop our ref to the previous caps */
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
|
|
|
|
gst_multifdsink_create_streamheader ("second", "header", &hbuf1, &hbuf2,
|
2006-05-11 11:40:39 +00:00
|
|
|
&caps);
|
|
|
|
fail_unless (gst_pad_set_caps (mysrcpad, caps));
|
2006-06-02 16:26:54 +00:00
|
|
|
/* one to hold for the test and one to give away */
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf1) == GST_FLOW_OK);
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, hbuf2) == GST_FLOW_OK);
|
|
|
|
|
|
|
|
/* verify neither client has new data available to read */
|
2006-06-02 16:35:12 +00:00
|
|
|
//fail_if_can_read ("first client, changed streamheader", pfd1[0]);
|
|
|
|
//fail_if_can_read ("second client, changed streamheader", pfd2[0]);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
/* now push another buffer, which will trigger streamheader for second
|
|
|
|
* client, but should also send new streamheaders to first client */
|
2006-06-02 16:26:54 +00:00
|
|
|
buf = gst_buffer_new_and_alloc (8);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf), "deadbabe", 8);
|
2006-05-11 11:40:39 +00:00
|
|
|
gst_pad_push (mysrcpad, buf);
|
|
|
|
|
2006-06-02 16:26:54 +00:00
|
|
|
fail_unless_read ("first client", pfd1[0], 6, "second");
|
|
|
|
fail_unless_read ("first client", pfd1[0], 6, "header");
|
|
|
|
fail_unless_read ("first client", pfd1[0], 8, "deadbabe");
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
/* new streamheader data */
|
2006-06-02 16:26:54 +00:00
|
|
|
fail_unless_read ("second client", pfd2[0], 6, "second");
|
|
|
|
fail_unless_read ("second client", pfd2[0], 6, "header");
|
2006-05-31 16:56:45 +00:00
|
|
|
/* we missed the f00d buffer */
|
2006-06-02 16:26:54 +00:00
|
|
|
fail_unless_read ("second client", pfd2[0], 8, "deadbabe");
|
|
|
|
//wait_bytes_served (sink, 36);
|
2006-05-11 11:40:39 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
2006-06-02 16:26:54 +00:00
|
|
|
g_signal_emit_by_name (sink, "remove", pfd1[1]);
|
|
|
|
g_signal_emit_by_name (sink, "remove", pfd2[1]);
|
2006-05-11 11:40:39 +00:00
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
/* setting to NULL should have cleared the streamheader */
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 1);
|
|
|
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 1);
|
|
|
|
gst_buffer_unref (hbuf1);
|
|
|
|
gst_buffer_unref (hbuf2);
|
2006-05-11 11:40:39 +00:00
|
|
|
cleanup_multifdsink (sink);
|
2006-06-02 16:26:54 +00:00
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
2006-05-11 11:40:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
gst/tcp/gstmultifdsink.*: Added shiny new burst-on-connect methods.
Original commit message from CVS:
* gst/tcp/gstmultifdsink.c: (gst_sync_method_get_type),
(gst_unit_type_get_type), (gst_multi_fd_sink_class_init),
(gst_multi_fd_sink_init), (gst_multi_fd_sink_add_full),
(gst_multi_fd_sink_add), (gst_multi_fd_sink_handle_client_read),
(find_syncframe), (find_limits), (assign_value),
(count_burst_unit), (gst_multi_fd_sink_new_client),
(gst_multi_fd_sink_handle_client_write),
(gst_multi_fd_sink_queue_buffer), (gst_multi_fd_sink_render),
(gst_multi_fd_sink_set_property), (gst_multi_fd_sink_get_property),
(gst_multi_fd_sink_change_state):
* gst/tcp/gstmultifdsink.h:
Added shiny new burst-on-connect methods.
Add properties to control the minimal amount of data queued.
Small cleanups.
API: bytes-min property
API: time-min property
API: buffers-min property
API: burst-unit property
API: burst-value property
API: add-full signal
* gst/tcp/gsttcp-marshal.list:
Added new marshaller code for the new signal.
* tests/check/elements/multifdsink.c: (GST_START_TEST),
(multifdsink_suite):
Added testcases for new burst methods.
2006-06-19 17:12:57 +00:00
|
|
|
/* keep 100 bytes and burst 80 bytes to clients */
|
|
|
|
GST_START_TEST (test_burst_client_bytes)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2];
|
|
|
|
int pfd2[2];
|
|
|
|
int pfd3[2];
|
|
|
|
gchar data[16];
|
|
|
|
gint i;
|
|
|
|
guint buffers_queued;
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
/* make sure we keep at least 100 bytes at all times */
|
|
|
|
g_object_set (sink, "bytes-min", 100, NULL);
|
|
|
|
g_object_set (sink, "sync-method", 3, NULL); /* 3 = burst */
|
|
|
|
g_object_set (sink, "burst-unit", 3, NULL); /* 3 = bytes */
|
|
|
|
g_object_set (sink, "burst-value", (guint64) 80, NULL);
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
fail_if (pipe (pfd2) == -1);
|
|
|
|
fail_if (pipe (pfd3) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
|
|
|
|
|
|
|
|
/* push buffers in, 9 * 16 bytes = 144 bytes */
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check that at least 7 buffers (112 bytes) are in the queue */
|
|
|
|
g_object_get (sink, "buffers-queued", &buffers_queued, NULL);
|
|
|
|
fail_if (buffers_queued != 7);
|
|
|
|
|
|
|
|
/* now add the clients */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd2[1], 3,
|
|
|
|
3, (guint64) 50, 3, (guint64) 200);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd3[1], 3,
|
|
|
|
3, (guint64) 50, 3, (guint64) 50);
|
|
|
|
|
|
|
|
/* push last buffer to make client fds ready for reading */
|
|
|
|
for (i = 9; i < 10; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we should only read the last 5 buffers (5 * 16 = 80 bytes) */
|
|
|
|
GST_DEBUG ("Reading from client 1");
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000005", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000006", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* second client only bursts 50 bytes = 4 buffers (we get 4 buffers since
|
|
|
|
* the max alows it) */
|
|
|
|
GST_DEBUG ("Reading from client 2");
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000006", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* third client only bursts 50 bytes = 4 buffers, we can't send
|
|
|
|
* more than 50 bytes so we only get 3 buffers (48 bytes). */
|
|
|
|
GST_DEBUG ("Reading from client 3");
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
/* keep 100 bytes and burst 80 bytes to clients */
|
|
|
|
GST_START_TEST (test_burst_client_bytes_keyframe)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2];
|
|
|
|
int pfd2[2];
|
|
|
|
int pfd3[2];
|
|
|
|
gchar data[16];
|
|
|
|
gint i;
|
|
|
|
guint buffers_queued;
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
/* make sure we keep at least 100 bytes at all times */
|
|
|
|
g_object_set (sink, "bytes-min", 100, NULL);
|
|
|
|
g_object_set (sink, "sync-method", 4, NULL); /* 3 = burst_keyframe */
|
|
|
|
g_object_set (sink, "burst-unit", 3, NULL); /* 3 = bytes */
|
|
|
|
g_object_set (sink, "burst-value", (guint64) 80, NULL);
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
fail_if (pipe (pfd2) == -1);
|
|
|
|
fail_if (pipe (pfd3) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
|
|
|
|
|
|
|
|
/* push buffers in, 9 * 16 bytes = 144 bytes */
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
|
|
|
|
/* mark most buffers as delta */
|
|
|
|
if (i != 0 && i != 4 && i != 8)
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check that at least 7 buffers (112 bytes) are in the queue */
|
|
|
|
g_object_get (sink, "buffers-queued", &buffers_queued, NULL);
|
|
|
|
fail_if (buffers_queued != 7);
|
|
|
|
|
|
|
|
/* now add the clients */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd2[1], 4,
|
|
|
|
3, (guint64) 50, 3, (guint64) 90);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd3[1], 4,
|
|
|
|
3, (guint64) 50, 3, (guint64) 50);
|
|
|
|
|
|
|
|
/* push last buffer to make client fds ready for reading */
|
|
|
|
for (i = 9; i < 10; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we should only read the last 6 buffers (min 5 * 16 = 80 bytes),
|
|
|
|
* keyframe at buffer 4 */
|
|
|
|
GST_DEBUG ("Reading from client 1");
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000004", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000005", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000006", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* second client only bursts 50 bytes = 4 buffers, there is
|
|
|
|
* no keyframe above min and below max, so get one below min */
|
|
|
|
GST_DEBUG ("Reading from client 2");
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* third client only bursts 50 bytes = 4 buffers, we can't send
|
|
|
|
* more than 50 bytes so we only get 2 buffers (32 bytes). */
|
|
|
|
GST_DEBUG ("Reading from client 3");
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
/* keep 100 bytes and burst 80 bytes to clients */
|
|
|
|
GST_START_TEST (test_burst_client_bytes_with_keyframe)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2];
|
|
|
|
int pfd2[2];
|
|
|
|
int pfd3[2];
|
|
|
|
gchar data[16];
|
|
|
|
gint i;
|
|
|
|
guint buffers_queued;
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
/* make sure we keep at least 100 bytes at all times */
|
|
|
|
g_object_set (sink, "bytes-min", 100, NULL);
|
|
|
|
g_object_set (sink, "sync-method", 5, NULL); /* 3 = burst_with_keyframe */
|
|
|
|
g_object_set (sink, "burst-unit", 3, NULL); /* 3 = bytes */
|
|
|
|
g_object_set (sink, "burst-value", (guint64) 80, NULL);
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
fail_if (pipe (pfd2) == -1);
|
|
|
|
fail_if (pipe (pfd3) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
|
|
|
|
|
|
|
|
/* push buffers in, 9 * 16 bytes = 144 bytes */
|
|
|
|
for (i = 0; i < 9; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
|
|
|
|
/* mark most buffers as delta */
|
|
|
|
if (i != 0 && i != 4 && i != 8)
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* check that at least 7 buffers (112 bytes) are in the queue */
|
|
|
|
g_object_get (sink, "buffers-queued", &buffers_queued, NULL);
|
|
|
|
fail_if (buffers_queued != 7);
|
|
|
|
|
|
|
|
/* now add the clients */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd2[1], 5,
|
|
|
|
3, (guint64) 50, 3, (guint64) 90);
|
|
|
|
g_signal_emit_by_name (sink, "add_full", pfd3[1], 5,
|
|
|
|
3, (guint64) 50, 3, (guint64) 50);
|
|
|
|
|
|
|
|
/* push last buffer to make client fds ready for reading */
|
|
|
|
for (i = 9; i < 10; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we should only read the last 6 buffers (min 5 * 16 = 80 bytes),
|
|
|
|
* keyframe at buffer 4 */
|
|
|
|
GST_DEBUG ("Reading from client 1");
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000004", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000005", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000006", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* second client only bursts 50 bytes = 4 buffers, there is
|
|
|
|
* no keyframe above min and below max, so send min */
|
|
|
|
GST_DEBUG ("Reading from client 2");
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000006", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd2[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
/* third client only bursts 50 bytes = 4 buffers, we can't send
|
|
|
|
* more than 50 bytes so we only get 3 buffers (48 bytes). */
|
|
|
|
GST_DEBUG ("Reading from client 3");
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000007", 16) == 0);
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000008", 16) == 0);
|
|
|
|
fail_if (read (pfd3[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000009", 16) == 0);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-09-07 19:00:33 +00:00
|
|
|
/* Check that we can get data when multifdsink is configured in next-keyframe
|
|
|
|
* mode */
|
|
|
|
GST_START_TEST (test_client_next_keyframe)
|
|
|
|
{
|
|
|
|
GstElement *sink;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GstCaps *caps;
|
|
|
|
int pfd1[2];
|
|
|
|
gchar data[16];
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
sink = setup_multifdsink ();
|
|
|
|
g_object_set (sink, "sync-method", 1, NULL); /* 1 = next-keyframe */
|
|
|
|
|
|
|
|
fail_if (pipe (pfd1) == -1);
|
|
|
|
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_PLAYING, GST_STATE_CHANGE_ASYNC);
|
|
|
|
|
|
|
|
caps = gst_caps_from_string ("application/x-gst-check");
|
|
|
|
GST_DEBUG ("Created test caps %p %" GST_PTR_FORMAT, caps, caps);
|
|
|
|
|
|
|
|
/* now add our client */
|
|
|
|
g_signal_emit_by_name (sink, "add", pfd1[1]);
|
|
|
|
|
|
|
|
/* push buffers in: keyframe, then non-keyframe */
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
gchar *data;
|
|
|
|
|
|
|
|
buffer = gst_buffer_new_and_alloc (16);
|
|
|
|
gst_buffer_set_caps (buffer, caps);
|
|
|
|
|
|
|
|
/* copy some id */
|
|
|
|
data = (gchar *) GST_BUFFER_DATA (buffer);
|
|
|
|
g_snprintf (data, 16, "deadbee%08x", i);
|
|
|
|
if (i > 0)
|
|
|
|
GST_BUFFER_FLAG_SET (buffer, GST_BUFFER_FLAG_DELTA_UNIT);
|
|
|
|
|
|
|
|
fail_unless (gst_pad_push (mysrcpad, buffer) == GST_FLOW_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* now we should be able to read some data */
|
|
|
|
GST_DEBUG ("Reading from client 1");
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000000", 16) == 0);
|
|
|
|
fail_if (read (pfd1[0], data, 16) < 16);
|
|
|
|
fail_unless (strncmp (data, "deadbee00000001", 16) == 0);
|
|
|
|
|
|
|
|
GST_DEBUG ("cleaning up multifdsink");
|
|
|
|
ASSERT_SET_STATE (sink, GST_STATE_NULL, GST_STATE_CHANGE_SUCCESS);
|
|
|
|
cleanup_multifdsink (sink);
|
|
|
|
|
|
|
|
ASSERT_CAPS_REFCOUNT (caps, "caps", 1);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-05-11 11:40:39 +00:00
|
|
|
/* FIXME: add test simulating chained oggs where:
|
|
|
|
* sync-method is burst-on-connect
|
|
|
|
* (when multifdsink actually does burst-on-connect based on byte size, not
|
|
|
|
"last keyframe" which any frame for audio :))
|
|
|
|
* an old client still needs to read from before the new streamheaders
|
|
|
|
* a new client gets the new streamheaders
|
|
|
|
*/
|
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static...
Original commit message from CVS:
* ext/alsa/gstalsamixertrack.c: (gst_alsa_mixer_track_get_type):
* ext/alsa/gstalsasink.c: (set_hwparams):
* ext/alsa/gstalsasrc.c: (set_hwparams):
* ext/gio/gstgio.c: (gst_gio_uri_handler_get_uri):
* ext/ogg/gstoggmux.h:
* ext/ogg/gstogmparse.c:
* gst-libs/gst/audio/audio.c:
* gst-libs/gst/fft/kiss_fft_f64.c: (kiss_fft_f64_alloc):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_uri_sink_message_new),
(gst_missing_element_message_new),
(gst_missing_decoder_message_new),
(gst_missing_encoder_message_new):
* gst-libs/gst/rtp/gstbasertppayload.c:
* gst-libs/gst/rtp/gstrtcpbuffer.c:
(gst_rtcp_packet_bye_get_reason):
* gst/audioconvert/gstaudioconvert.c:
* gst/audioresample/gstaudioresample.c:
* gst/ffmpegcolorspace/imgconvert.c:
* gst/playback/test.c: (gen_video_element), (gen_audio_element):
* gst/typefind/gsttypefindfunctions.c:
* gst/videoscale/vs_4tap.c:
* gst/videoscale/vs_4tap.h:
* sys/v4l/gstv4lelement.c:
* sys/v4l/gstv4lsrc.c: (gst_v4lsrc_get_any_caps):
* sys/v4l/v4l_calls.c:
* sys/v4l/v4lsrc_calls.c: (gst_v4lsrc_capture_init),
(gst_v4lsrc_try_capture):
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new):
* tests/check/elements/audioconvert.c:
* tests/check/elements/audioresample.c:
(fail_unless_perfect_stream):
* tests/check/elements/audiotestsrc.c: (setup_audiotestsrc):
* tests/check/elements/decodebin.c:
* tests/check/elements/gdpdepay.c: (setup_gdpdepay),
(setup_gdpdepay_streamheader):
* tests/check/elements/gdppay.c: (setup_gdppay), (GST_START_TEST),
(setup_gdppay_streamheader):
* tests/check/elements/gnomevfssink.c: (setup_gnomevfssink):
* tests/check/elements/multifdsink.c: (setup_multifdsink):
* tests/check/elements/textoverlay.c:
* tests/check/elements/videorate.c: (setup_videorate):
* tests/check/elements/videotestsrc.c: (setup_videotestsrc):
* tests/check/elements/volume.c: (setup_volume):
* tests/check/elements/vorbisdec.c: (setup_vorbisdec):
* tests/check/elements/vorbistag.c:
* tests/check/generic/clock-selection.c:
* tests/check/generic/states.c: (setup), (teardown):
* tests/check/libs/cddabasesrc.c:
* tests/check/libs/video.c:
* tests/check/pipelines/gio.c:
* tests/check/pipelines/oggmux.c:
* tests/check/pipelines/simple-launch-lines.c:
(simple_launch_lines_suite):
* tests/check/pipelines/streamheader.c:
* tests/check/pipelines/theoraenc.c:
* tests/check/pipelines/vorbisdec.c:
* tests/check/pipelines/vorbisenc.c:
* tests/examples/seek/scrubby.c:
* tests/examples/seek/seek.c: (query_positions_elems),
(query_positions_pads):
* tests/icles/stress-xoverlay.c: (myclock):
Correct all relevant warnings found by the sparse semantic code
analyzer. This include marking several symbols static, using
NULL instead of 0 for pointers and using "foo (void)" instead
of "foo ()" for declarations.
* win32/common/libgstrtp.def:
Add gst_rtp_buffer_set_extension_data to the symbol definition file.
2008-03-03 06:04:31 +00:00
|
|
|
static Suite *
|
2006-05-10 16:34:06 +00:00
|
|
|
multifdsink_suite (void)
|
|
|
|
{
|
|
|
|
Suite *s = suite_create ("multifdsink");
|
|
|
|
TCase *tc_chain = tcase_create ("general");
|
|
|
|
|
|
|
|
suite_add_tcase (s, tc_chain);
|
2006-05-31 16:56:45 +00:00
|
|
|
tcase_add_test (tc_chain, test_no_clients);
|
|
|
|
tcase_add_test (tc_chain, test_add_client);
|
|
|
|
tcase_add_test (tc_chain, test_streamheader);
|
2006-05-11 11:40:39 +00:00
|
|
|
tcase_add_test (tc_chain, test_change_streamheader);
|
gst/tcp/gstmultifdsink.*: Added shiny new burst-on-connect methods.
Original commit message from CVS:
* gst/tcp/gstmultifdsink.c: (gst_sync_method_get_type),
(gst_unit_type_get_type), (gst_multi_fd_sink_class_init),
(gst_multi_fd_sink_init), (gst_multi_fd_sink_add_full),
(gst_multi_fd_sink_add), (gst_multi_fd_sink_handle_client_read),
(find_syncframe), (find_limits), (assign_value),
(count_burst_unit), (gst_multi_fd_sink_new_client),
(gst_multi_fd_sink_handle_client_write),
(gst_multi_fd_sink_queue_buffer), (gst_multi_fd_sink_render),
(gst_multi_fd_sink_set_property), (gst_multi_fd_sink_get_property),
(gst_multi_fd_sink_change_state):
* gst/tcp/gstmultifdsink.h:
Added shiny new burst-on-connect methods.
Add properties to control the minimal amount of data queued.
Small cleanups.
API: bytes-min property
API: time-min property
API: buffers-min property
API: burst-unit property
API: burst-value property
API: add-full signal
* gst/tcp/gsttcp-marshal.list:
Added new marshaller code for the new signal.
* tests/check/elements/multifdsink.c: (GST_START_TEST),
(multifdsink_suite):
Added testcases for new burst methods.
2006-06-19 17:12:57 +00:00
|
|
|
tcase_add_test (tc_chain, test_burst_client_bytes);
|
|
|
|
tcase_add_test (tc_chain, test_burst_client_bytes_keyframe);
|
|
|
|
tcase_add_test (tc_chain, test_burst_client_bytes_with_keyframe);
|
2006-09-07 19:00:33 +00:00
|
|
|
tcase_add_test (tc_chain, test_client_next_keyframe);
|
2006-05-10 16:34:06 +00:00
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int nf;
|
|
|
|
|
|
|
|
Suite *s = multifdsink_suite ();
|
|
|
|
SRunner *sr = srunner_create (s);
|
|
|
|
|
|
|
|
gst_check_init (&argc, &argv);
|
|
|
|
|
|
|
|
srunner_run_all (sr, CK_NORMAL);
|
|
|
|
nf = srunner_ntests_failed (sr);
|
|
|
|
srunner_free (sr);
|
|
|
|
|
|
|
|
return nf;
|
|
|
|
}
|