2006-01-30 17:01:54 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
|
|
|
* unit test for theoraenc
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006 Andy Wingo <wingo at pobox.com>
|
|
|
|
*
|
|
|
|
* 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 <gst/check/gstcheck.h>
|
2006-07-21 15:59:24 +00:00
|
|
|
#include <gst/check/gstbufferstraw.h>
|
2006-01-30 17:01:54 +00:00
|
|
|
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
#include <theora/theora.h>
|
|
|
|
|
2006-05-28 09:37:18 +00:00
|
|
|
#ifndef GST_DISABLE_PARSE
|
|
|
|
|
2006-01-31 16:26:57 +00:00
|
|
|
#define TIMESTAMP_OFFSET G_GINT64_CONSTANT(3249870963)
|
2006-01-30 17:01:54 +00:00
|
|
|
#define FRAMERATE 10
|
|
|
|
|
2006-01-30 19:21:07 +00:00
|
|
|
/* I know all of these have a shift of 6 bits */
|
|
|
|
#define GRANULEPOS_SHIFT 6
|
|
|
|
|
2006-03-03 15:22:02 +00:00
|
|
|
|
2008-01-06 14:39:19 +00:00
|
|
|
#define check_buffer_is_header(buffer,is_header) \
|
|
|
|
fail_unless (GST_BUFFER_FLAG_IS_SET (buffer, \
|
|
|
|
GST_BUFFER_FLAG_IN_CAPS) == is_header, \
|
|
|
|
"GST_BUFFER_IN_CAPS is set to %d but expected %d", \
|
|
|
|
GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_IN_CAPS), is_header)
|
2006-01-30 17:01:54 +00:00
|
|
|
|
2008-01-06 14:39:19 +00:00
|
|
|
#define check_buffer_timestamp(buffer,timestamp) \
|
|
|
|
fail_unless (GST_BUFFER_TIMESTAMP (buffer) == timestamp, \
|
|
|
|
"expected timestamp %" GST_TIME_FORMAT \
|
|
|
|
", but got timestamp %" GST_TIME_FORMAT, \
|
|
|
|
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buffer)))
|
|
|
|
|
|
|
|
#define check_buffer_duration(buffer,duration) \
|
|
|
|
fail_unless (GST_BUFFER_DURATION (buffer) == duration, \
|
|
|
|
"expected duration %" GST_TIME_FORMAT \
|
|
|
|
", but got duration %" GST_TIME_FORMAT, \
|
|
|
|
GST_TIME_ARGS (duration), GST_TIME_ARGS (GST_BUFFER_DURATION (buffer)))
|
2006-01-30 17:01:54 +00:00
|
|
|
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
static gboolean old_libtheora;
|
|
|
|
|
|
|
|
static void
|
|
|
|
check_libtheora (void)
|
|
|
|
{
|
|
|
|
old_libtheora = (theora_version_number () <= 0x00030200);
|
|
|
|
}
|
|
|
|
|
2006-01-30 17:01:54 +00:00
|
|
|
static void
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
check_buffer_granulepos (GstBuffer * buffer, gint64 granulepos)
|
2006-01-30 17:01:54 +00:00
|
|
|
{
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
GstClockTime clocktime;
|
ext/theora/: Mark discontinuities of > 3/4 of a frame, reinit encoder.
Original commit message from CVS:
* ext/theora/gsttheoraenc.h:
* ext/theora/theoraenc.c: (gst_theora_enc_init),
(theora_enc_reset), (theora_enc_clear), (theora_enc_sink_setcaps),
(theora_buffer_from_packet), (theora_enc_is_discontinuous),
(theora_enc_chain), (theora_enc_change_state):
Mark discontinuities of > 3/4 of a frame, reinit encoder.
* tests/check/pipelines/theoraenc.c: (check_buffer_granulepos),
(GST_START_TEST), (theoraenc_suite):
Enable discontinuity test, fix it.
2006-11-22 14:34:03 +00:00
|
|
|
int framecount;
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
/* With old versions of libtheora, the granulepos represented the
|
|
|
|
* start time, not end time. Adapt for that. */
|
|
|
|
if (old_libtheora) {
|
|
|
|
if (granulepos >> GRANULEPOS_SHIFT)
|
|
|
|
granulepos -= 1 << GRANULEPOS_SHIFT;
|
|
|
|
else if (granulepos)
|
|
|
|
granulepos -= 1;
|
|
|
|
}
|
|
|
|
|
2006-01-30 17:01:54 +00:00
|
|
|
fail_unless (GST_BUFFER_OFFSET_END (buffer) == granulepos,
|
|
|
|
"expected granulepos %" G_GUINT64_FORMAT
|
|
|
|
", but got granulepos %" G_GUINT64_FORMAT,
|
|
|
|
granulepos, GST_BUFFER_OFFSET_END (buffer));
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
|
|
|
|
/* contrary to what we record as TIMESTAMP, we can use OFFSET to check
|
|
|
|
* the granulepos correctly here */
|
ext/theora/: Mark discontinuities of > 3/4 of a frame, reinit encoder.
Original commit message from CVS:
* ext/theora/gsttheoraenc.h:
* ext/theora/theoraenc.c: (gst_theora_enc_init),
(theora_enc_reset), (theora_enc_clear), (theora_enc_sink_setcaps),
(theora_buffer_from_packet), (theora_enc_is_discontinuous),
(theora_enc_chain), (theora_enc_change_state):
Mark discontinuities of > 3/4 of a frame, reinit encoder.
* tests/check/pipelines/theoraenc.c: (check_buffer_granulepos),
(GST_START_TEST), (theoraenc_suite):
Enable discontinuity test, fix it.
2006-11-22 14:34:03 +00:00
|
|
|
framecount = GST_BUFFER_OFFSET_END (buffer);
|
|
|
|
framecount = granulepos >> GRANULEPOS_SHIFT;
|
|
|
|
framecount += granulepos & ((1 << GRANULEPOS_SHIFT) - 1);
|
|
|
|
clocktime = gst_util_uint64_scale (framecount, GST_SECOND, FRAMERATE);
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
|
|
|
|
fail_unless (clocktime == GST_BUFFER_OFFSET (buffer),
|
|
|
|
"expected OFFSET set to clocktime %" GST_TIME_FORMAT
|
|
|
|
", but got %" GST_TIME_FORMAT,
|
|
|
|
GST_TIME_ARGS (clocktime), GST_TIME_ARGS (GST_BUFFER_OFFSET (buffer)));
|
2006-01-30 17:01:54 +00:00
|
|
|
}
|
|
|
|
|
2006-02-02 08:47:42 +00:00
|
|
|
/* this check is here to check that the granulepos we derive from the
|
|
|
|
timestamp is about correct. This is "about correct" because you can't
|
|
|
|
precisely go from timestamp to granulepos due to the downward-rounding
|
|
|
|
characteristics of gst_util_uint64_scale, so you check if granulepos is
|
|
|
|
equal to the number, or the number plus one. */
|
2006-01-30 17:01:54 +00:00
|
|
|
/* should be from_endtime, but theora's granulepos mapping is "special" */
|
|
|
|
static void
|
|
|
|
check_buffer_granulepos_from_starttime (GstBuffer * buffer,
|
|
|
|
GstClockTime starttime)
|
|
|
|
{
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
gint64 granulepos, expected, framecount;
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
granulepos = GST_BUFFER_OFFSET_END (buffer);
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
/* Now convert to 'granulepos for start time', depending on libtheora
|
|
|
|
* version */
|
|
|
|
if (!old_libtheora) {
|
|
|
|
if (granulepos & ((1 << GRANULEPOS_SHIFT) - 1))
|
|
|
|
granulepos -= 1;
|
|
|
|
else if (granulepos)
|
|
|
|
granulepos -= 1 << GRANULEPOS_SHIFT;
|
|
|
|
}
|
|
|
|
|
2006-01-30 19:21:07 +00:00
|
|
|
framecount = granulepos >> GRANULEPOS_SHIFT;
|
|
|
|
framecount += granulepos & ((1 << GRANULEPOS_SHIFT) - 1);
|
2006-01-30 17:01:54 +00:00
|
|
|
expected = gst_util_uint64_scale (starttime, FRAMERATE, GST_SECOND);
|
|
|
|
|
2006-01-30 19:21:07 +00:00
|
|
|
fail_unless (framecount == expected || framecount == expected + 1,
|
|
|
|
"expected frame count %" G_GUINT64_FORMAT
|
2006-01-30 17:01:54 +00:00
|
|
|
" or %" G_GUINT64_FORMAT
|
2006-01-30 19:21:07 +00:00
|
|
|
", but got frame count %" G_GUINT64_FORMAT,
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
expected, expected + 1, framecount);
|
2006-01-30 17:01:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_START_TEST (test_granulepos_offset)
|
|
|
|
{
|
|
|
|
GstElement *bin;
|
|
|
|
GstPad *pad;
|
|
|
|
gchar *pipe_str;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
|
|
|
pipe_str = g_strdup_printf ("videotestsrc timestamp-offset=%" G_GUINT64_FORMAT
|
2008-12-11 10:33:48 +00:00
|
|
|
" num-buffers=10 ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
|
2006-02-06 12:38:48 +00:00
|
|
|
" ! theoraenc ! fakesink name=fs0", TIMESTAMP_OFFSET);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
bin = gst_parse_launch (pipe_str, &error);
|
|
|
|
fail_unless (bin != NULL, "Error parsing pipeline: %s",
|
|
|
|
error ? error->message : "(invalid error)");
|
|
|
|
g_free (pipe_str);
|
|
|
|
|
|
|
|
/* get the pad */
|
|
|
|
{
|
2006-02-06 12:38:48 +00:00
|
|
|
GstElement *sink = gst_bin_get_by_name (GST_BIN (bin), "fs0");
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
fail_unless (sink != NULL, "Could not get fakesink out of bin");
|
Don't use bad gst_element_get_pad().
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind):
* gst/playback/decodetest.c: (new_decoded_pad_cb):
* gst/playback/gstdecodebin.c: (gst_decode_bin_init),
(try_to_link_1), (elem_is_dynamic), (close_link), (type_found),
(cleanup_decodebin):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_init),
(connect_element), (gst_decode_group_control_demuxer_pad):
* gst/playback/gstplaybasebin.c: (queue_remove_probe),
(queue_out_of_data), (gen_preroll_element), (preroll_unlinked),
(mute_group_type):
* gst/playback/gstplaybin.c: (gst_play_bin_vis_blocked),
(gst_play_bin_set_property), (handoff), (gen_video_element),
(gen_text_element), (gen_audio_element), (gen_vis_element),
(remove_sinks), (add_sink), (setup_sinks):
* gst/playback/gstplaybin2.c: (pad_added_cb), (no_more_pads_cb):
* gst/playback/gstplaysink.c: (gst_play_sink_get_video_sink),
(gst_play_sink_get_audio_sink), (gst_play_sink_vis_unblocked),
(gst_play_sink_vis_blocked), (gst_play_sink_set_vis_plugin),
(gst_play_sink_get_vis_plugin), (gst_play_sink_set_mute),
(gen_video_chain), (gen_text_chain), (gen_audio_chain),
(gen_vis_chain), (gst_play_sink_reconfigure),
(gst_play_sink_set_font_desc), (gst_play_sink_get_font_desc),
(gst_play_sink_request_pad):
* gst/playback/gsturidecodebin.c: (type_found), (setup_source):
* gst/playback/test.c: (gen_video_element), (gen_audio_element),
(cb_newpad):
* gst/playback/test6.c: (new_decoded_pad_cb):
* tests/check/elements/audioconvert.c: (GST_START_TEST):
* tests/check/elements/audiorate.c: (test_injector_chain),
(do_perfect_stream_test):
* tests/check/elements/ffmpegcolorspace.c: (GST_START_TEST):
* tests/check/elements/gdpdepay.c: (GST_START_TEST):
* tests/check/elements/gnomevfssink.c:
* tests/check/elements/textoverlay.c:
(notgst_check_setup_src_pad2), (notgst_check_teardown_src_pad2):
* tests/check/elements/videotestsrc.c: (GST_START_TEST):
* tests/check/libs/cddabasesrc.c: (GST_START_TEST):
* tests/check/pipelines/oggmux.c: (test_pipeline):
* tests/check/pipelines/streamheader.c: (GST_START_TEST):
* tests/check/pipelines/theoraenc.c: (GST_START_TEST):
* tests/check/pipelines/vorbisenc.c: (GST_START_TEST):
* tests/examples/seek/scrubby.c: (make_wav_pipeline):
* tests/examples/seek/seek.c: (make_mod_pipeline),
(make_dv_pipeline), (make_wav_pipeline), (make_flac_pipeline),
(make_sid_pipeline), (make_parse_pipeline), (make_vorbis_pipeline),
(make_theora_pipeline), (make_vorbis_theora_pipeline),
(make_avi_msmpeg4v3_mp3_pipeline), (make_mp3_pipeline),
(make_avi_pipeline), (make_mpeg_pipeline), (make_mpegnt_pipeline),
(update_fill), (msg_buffering):
Don't use bad gst_element_get_pad().
2008-05-21 16:36:50 +00:00
|
|
|
pad = gst_element_get_static_pad (sink, "sink");
|
2006-01-30 17:01:54 +00:00
|
|
|
fail_unless (pad != NULL, "Could not get pad out of fakesink");
|
|
|
|
gst_object_unref (sink);
|
|
|
|
}
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
gst_buffer_straw_start_pipeline (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
2006-03-03 15:22:02 +00:00
|
|
|
/* header packets should have timestamp == NONE, granulepos 0, IN_CAPS */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
|
|
|
{
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
GstClockTime next_timestamp;
|
|
|
|
gint64 last_granulepos;
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
/* first buffer should have timestamp of TIMESTAMP_OFFSET, granulepos to
|
|
|
|
* match the timestamp of the end of the last sample in the output buffer.
|
2006-02-02 08:47:42 +00:00
|
|
|
* Note that one cannot go timestamp->granulepos->timestamp and get the
|
|
|
|
* same value due to loss of precision with granulepos. theoraenc does
|
|
|
|
* take care to timestamp correctly based on the offset of the input data
|
|
|
|
* however, so it does do sub-granulepos timestamping. */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
last_granulepos = GST_BUFFER_OFFSET_END (buffer);
|
|
|
|
check_buffer_timestamp (buffer, TIMESTAMP_OFFSET);
|
|
|
|
/* don't really have a good way of checking duration... */
|
|
|
|
check_buffer_granulepos_from_starttime (buffer, TIMESTAMP_OFFSET);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, FALSE);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
next_timestamp = TIMESTAMP_OFFSET + GST_BUFFER_DURATION (buffer);
|
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
|
|
|
/* check continuity with the next buffer */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, next_timestamp);
|
|
|
|
check_buffer_duration (buffer,
|
|
|
|
gst_util_uint64_scale (GST_BUFFER_OFFSET_END (buffer), GST_SECOND,
|
|
|
|
FRAMERATE)
|
|
|
|
- gst_util_uint64_scale (last_granulepos, GST_SECOND, FRAMERATE));
|
|
|
|
check_buffer_granulepos_from_starttime (buffer, next_timestamp);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, FALSE);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
}
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
gst_buffer_straw_stop_pipeline (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
gst_object_unref (pad);
|
|
|
|
gst_object_unref (bin);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
|
|
|
GST_START_TEST (test_continuity)
|
|
|
|
{
|
|
|
|
GstElement *bin;
|
|
|
|
GstPad *pad;
|
|
|
|
gchar *pipe_str;
|
|
|
|
GstBuffer *buffer;
|
|
|
|
GError *error = NULL;
|
|
|
|
|
2008-12-11 10:33:48 +00:00
|
|
|
pipe_str = g_strdup_printf ("videotestsrc num-buffers=10"
|
2006-01-30 17:01:54 +00:00
|
|
|
" ! video/x-raw-yuv,format=(fourcc)I420,framerate=10/1"
|
2006-02-06 12:38:48 +00:00
|
|
|
" ! theoraenc ! fakesink name=fs0");
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
bin = gst_parse_launch (pipe_str, &error);
|
|
|
|
fail_unless (bin != NULL, "Error parsing pipeline: %s",
|
|
|
|
error ? error->message : "(invalid error)");
|
|
|
|
g_free (pipe_str);
|
|
|
|
|
|
|
|
/* get the pad */
|
|
|
|
{
|
2006-02-06 12:38:48 +00:00
|
|
|
GstElement *sink = gst_bin_get_by_name (GST_BIN (bin), "fs0");
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
fail_unless (sink != NULL, "Could not get fakesink out of bin");
|
Don't use bad gst_element_get_pad().
Original commit message from CVS:
* ext/ogg/gstoggdemux.c: (gst_ogg_pad_typefind):
* gst/playback/decodetest.c: (new_decoded_pad_cb):
* gst/playback/gstdecodebin.c: (gst_decode_bin_init),
(try_to_link_1), (elem_is_dynamic), (close_link), (type_found),
(cleanup_decodebin):
* gst/playback/gstdecodebin2.c: (gst_decode_bin_init),
(connect_element), (gst_decode_group_control_demuxer_pad):
* gst/playback/gstplaybasebin.c: (queue_remove_probe),
(queue_out_of_data), (gen_preroll_element), (preroll_unlinked),
(mute_group_type):
* gst/playback/gstplaybin.c: (gst_play_bin_vis_blocked),
(gst_play_bin_set_property), (handoff), (gen_video_element),
(gen_text_element), (gen_audio_element), (gen_vis_element),
(remove_sinks), (add_sink), (setup_sinks):
* gst/playback/gstplaybin2.c: (pad_added_cb), (no_more_pads_cb):
* gst/playback/gstplaysink.c: (gst_play_sink_get_video_sink),
(gst_play_sink_get_audio_sink), (gst_play_sink_vis_unblocked),
(gst_play_sink_vis_blocked), (gst_play_sink_set_vis_plugin),
(gst_play_sink_get_vis_plugin), (gst_play_sink_set_mute),
(gen_video_chain), (gen_text_chain), (gen_audio_chain),
(gen_vis_chain), (gst_play_sink_reconfigure),
(gst_play_sink_set_font_desc), (gst_play_sink_get_font_desc),
(gst_play_sink_request_pad):
* gst/playback/gsturidecodebin.c: (type_found), (setup_source):
* gst/playback/test.c: (gen_video_element), (gen_audio_element),
(cb_newpad):
* gst/playback/test6.c: (new_decoded_pad_cb):
* tests/check/elements/audioconvert.c: (GST_START_TEST):
* tests/check/elements/audiorate.c: (test_injector_chain),
(do_perfect_stream_test):
* tests/check/elements/ffmpegcolorspace.c: (GST_START_TEST):
* tests/check/elements/gdpdepay.c: (GST_START_TEST):
* tests/check/elements/gnomevfssink.c:
* tests/check/elements/textoverlay.c:
(notgst_check_setup_src_pad2), (notgst_check_teardown_src_pad2):
* tests/check/elements/videotestsrc.c: (GST_START_TEST):
* tests/check/libs/cddabasesrc.c: (GST_START_TEST):
* tests/check/pipelines/oggmux.c: (test_pipeline):
* tests/check/pipelines/streamheader.c: (GST_START_TEST):
* tests/check/pipelines/theoraenc.c: (GST_START_TEST):
* tests/check/pipelines/vorbisenc.c: (GST_START_TEST):
* tests/examples/seek/scrubby.c: (make_wav_pipeline):
* tests/examples/seek/seek.c: (make_mod_pipeline),
(make_dv_pipeline), (make_wav_pipeline), (make_flac_pipeline),
(make_sid_pipeline), (make_parse_pipeline), (make_vorbis_pipeline),
(make_theora_pipeline), (make_vorbis_theora_pipeline),
(make_avi_msmpeg4v3_mp3_pipeline), (make_mp3_pipeline),
(make_avi_pipeline), (make_mpeg_pipeline), (make_mpegnt_pipeline),
(update_fill), (msg_buffering):
Don't use bad gst_element_get_pad().
2008-05-21 16:36:50 +00:00
|
|
|
pad = gst_element_get_static_pad (sink, "sink");
|
2006-01-30 17:01:54 +00:00
|
|
|
fail_unless (pad != NULL, "Could not get pad out of fakesink");
|
|
|
|
gst_object_unref (sink);
|
|
|
|
}
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
gst_buffer_straw_start_pipeline (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
/* header packets should have timestamp == NONE, granulepos 0 */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_duration (buffer, GST_CLOCK_TIME_NONE);
|
|
|
|
check_buffer_granulepos (buffer, 0);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, TRUE);
|
2006-01-30 17:01:54 +00:00
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
|
|
|
{
|
ogg muxing of vorbis and theora now has pages ordered correctly again, even with delays.
Original commit message from CVS:
ogg muxing of vorbis and theora now has pages ordered correctly again,
even with delays.
* ext/ogg/README:
updated with some examples
* ext/theora/theoraenc.c: (granulepos_to_timestamp),
(granulepos_add), (theora_buffer_from_packet):
* ext/vorbis/vorbisenc.c: (granulepos_to_timestamp_offset),
(granulepos_to_timestamp), (gst_vorbisenc_buffer_from_packet),
(gst_vorbisenc_chain):
implement strategy from ext/ogg/README
* ext/ogg/gstoggmux.c: (gst_ogg_mux_buffer_from_page),
(gst_ogg_mux_push_buffer), (gst_ogg_mux_dequeue_page),
(gst_ogg_mux_pad_queue_page), (gst_ogg_mux_compare_pads),
(gst_ogg_mux_queue_pads), (gst_ogg_mux_collected):
Fix muxer so that oggz-validate is happy with all streams;
except for no eos mark, and the BOS page ordering
* tests/check/pipelines/theoraenc.c: (check_buffer_is_header),
(check_buffer_granulepos):
* tests/check/pipelines/vorbisenc.c: (check_buffer_granulepos):
update tests to check for OFFSET being set as requested
fixed type of granulepos, it's not a ClockTime
2006-03-05 22:57:58 +00:00
|
|
|
GstClockTime next_timestamp;
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
/* first buffer should have timestamp of TIMESTAMP_OFFSET, granulepos to
|
|
|
|
* match the timestamp of the end of the last sample in the output buffer.
|
2006-02-02 08:47:42 +00:00
|
|
|
* Note that one cannot go timestamp->granulepos->timestamp and get the
|
|
|
|
* same value due to loss of precision with granulepos. theoraenc does
|
|
|
|
* take care to timestamp correctly based on the offset of the input data
|
|
|
|
* however, so it does do sub-granulepos timestamping. */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, 0);
|
2006-02-02 08:47:42 +00:00
|
|
|
/* plain division because I know the answer is exact */
|
|
|
|
check_buffer_duration (buffer, GST_SECOND / 10);
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
check_buffer_granulepos (buffer, 1 << GRANULEPOS_SHIFT);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, FALSE);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
next_timestamp = GST_BUFFER_DURATION (buffer);
|
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
|
|
|
|
/* check continuity with the next buffer */
|
2006-07-21 15:59:24 +00:00
|
|
|
buffer = gst_buffer_straw_get_buffer (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
check_buffer_timestamp (buffer, next_timestamp);
|
|
|
|
check_buffer_duration (buffer, GST_SECOND / 10);
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
check_buffer_granulepos (buffer, (1 << GRANULEPOS_SHIFT) | 1);
|
2006-03-03 15:22:02 +00:00
|
|
|
check_buffer_is_header (buffer, FALSE);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
gst_buffer_unref (buffer);
|
|
|
|
}
|
|
|
|
|
2006-07-21 15:59:24 +00:00
|
|
|
gst_buffer_straw_stop_pipeline (bin, pad);
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
gst_object_unref (pad);
|
|
|
|
gst_object_unref (bin);
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_END_TEST;
|
|
|
|
|
2006-07-21 17:04:06 +00:00
|
|
|
|
2006-05-28 09:37:18 +00:00
|
|
|
#endif /* #ifndef GST_DISABLE_PARSE */
|
|
|
|
|
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-01-30 17:01:54 +00:00
|
|
|
theoraenc_suite (void)
|
|
|
|
{
|
|
|
|
Suite *s = suite_create ("theoraenc");
|
|
|
|
TCase *tc_chain = tcase_create ("general");
|
|
|
|
|
|
|
|
suite_add_tcase (s, tc_chain);
|
2006-05-28 09:37:18 +00:00
|
|
|
|
ext/theora/theoradec.c: Adapt for post-alpha meaning of granulepos, when we have a newer version of libtheora.
Original commit message from CVS:
* ext/theora/theoradec.c: (gst_theora_dec_class_init),
(_theora_granule_frame), (_theora_granule_start_time),
(theora_dec_sink_convert), (theora_dec_decode_buffer):
Adapt for post-alpha meaning of granulepos, when we
have a newer version of libtheora.
* ext/theora/theoraenc.c: (gst_theora_enc_class_init),
(theora_enc_get_ogg_packet_end_time), (theora_enc_sink_event),
(theora_enc_is_discontinuous), (theora_enc_chain):
Likewise.
* tests/check/Makefile.am:
Link libtheora into theoraenc test so we can check which version of
libtheora we're testing against.
* tests/check/pipelines/theoraenc.c: (check_libtheora),
(check_buffer_granulepos),
(check_buffer_granulepos_from_starttime), (GST_START_TEST),
(theoraenc_suite):
Adapt tests to check the values that are now defined for theora; make
the tests backwards-adapt the passed values if we're running against an
old libtheora.
Fixes #497964
2008-01-11 15:48:11 +00:00
|
|
|
check_libtheora ();
|
|
|
|
|
2006-05-28 09:37:18 +00:00
|
|
|
#ifndef GST_DISABLE_PARSE
|
2006-01-30 17:01:54 +00:00
|
|
|
tcase_add_test (tc_chain, test_granulepos_offset);
|
|
|
|
tcase_add_test (tc_chain, test_continuity);
|
2006-05-28 09:37:18 +00:00
|
|
|
#endif
|
2006-01-30 17:01:54 +00:00
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
int nf;
|
|
|
|
|
|
|
|
Suite *s = theoraenc_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;
|
|
|
|
}
|