~ubuntu-branches/ubuntu/trusty/gstreamer1.0/trusty

« back to all changes in this revision

Viewing changes to libs/gst/check/gstconsistencychecker.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2012-08-08 18:12:33 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120808181233-riejwxprfsxh1njl
Tags: 0.11.93-1
* New upstream release:
  + debian/libgstreamer.symbols:
    - Update symbols file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 *
28
28
 * These macros and functions are for internal use of the unit tests found
29
29
 * inside the 'check' directories of various GStreamer packages.
30
 
 *
31
 
 * Since: 0.10.24
32
30
 */
33
31
 
34
32
#include "gstconsistencychecker.h"
40
38
  volatile gboolean segment;
41
39
  volatile gboolean eos;
42
40
  volatile gboolean expect_flush;
 
41
  volatile gboolean saw_serialized_event;
 
42
  volatile gboolean saw_stream_start;
43
43
  GstObject *parent;
44
44
  GList *pads;
45
45
};
71
71
  } else if (GST_IS_EVENT (data)) {
72
72
    GstEvent *event = (GstEvent *) data;
73
73
 
74
 
    GST_DEBUG_OBJECT (pad, "%s", GST_EVENT_TYPE_NAME (event));
 
74
    GST_DEBUG_OBJECT (pad, "Event : %s", GST_EVENT_TYPE_NAME (event));
75
75
    switch (GST_EVENT_TYPE (event)) {
76
76
      case GST_EVENT_FLUSH_START:
77
77
        /* getting two flush_start in a row seems to be okay
87
87
        consist->flushing = consist->expect_flush = FALSE;
88
88
        break;
89
89
      case GST_EVENT_STREAM_START:
 
90
        fail_if (consist->saw_serialized_event && !consist->saw_stream_start,
 
91
            "Got a STREAM_START event after a serialized event");
 
92
        consist->saw_stream_start = TRUE;
 
93
        break;
90
94
      case GST_EVENT_STREAM_CONFIG:
91
95
      case GST_EVENT_CAPS:
92
96
        /* ok to have these before segment event */
116
120
        /* FIXME : Figure out what to do for other events */
117
121
        break;
118
122
    }
 
123
    if (GST_EVENT_IS_SERIALIZED (event)) {
 
124
      fail_if (!consist->saw_stream_start
 
125
          && GST_EVENT_TYPE (event) != GST_EVENT_STREAM_START,
 
126
          "Got a serialized event (%s) before a STREAM_START",
 
127
          GST_EVENT_TYPE_NAME (event));
 
128
      consist->saw_serialized_event = TRUE;
 
129
    }
119
130
  }
120
131
 
121
132
  return TRUE;
198
209
 * data flow is inconsistent.
199
210
 *
200
211
 * Returns: A #GstStreamConsistency structure used to track data flow.
201
 
 *
202
 
 * Since: 0.10.24
203
212
 */
204
213
GstStreamConsistency *
205
214
gst_consistency_checker_new (GstPad * pad)
226
235
 * data flow is inconsistent.
227
236
 *
228
237
 * Returns: %TRUE if the pad was added
229
 
 *
230
 
 * Since: 0.10.37
231
238
 */
232
239
gboolean
233
240
gst_consistency_checker_add_pad (GstStreamConsistency * consist, GstPad * pad)
245
252
 * @consist: The #GstStreamConsistency to reset.
246
253
 *
247
254
 * Reset the stream checker's internal variables.
248
 
 *
249
 
 * Since: 0.10.24
250
255
 */
251
256
 
252
257
void
253
258
gst_consistency_checker_reset (GstStreamConsistency * consist)
254
259
{
255
 
  consist->eos = FALSE;
256
260
  consist->flushing = FALSE;
257
261
  consist->segment = FALSE;
 
262
  consist->eos = FALSE;
 
263
  consist->expect_flush = FALSE;
 
264
  consist->saw_serialized_event = FALSE;
 
265
  consist->saw_stream_start = FALSE;
258
266
}
259
267
 
260
268
/**
262
270
 * @consist: The #GstStreamConsistency to free.
263
271
 *
264
272
 * Frees the allocated data and probes associated with @consist.
265
 
 *
266
 
 * Since: 0.10.24
267
273
 */
268
274
 
269
275
void