GST_TIME_FORMAT " max %" GST_TIME_FORMAT,
GST_TIME_ARGS (min_latency), GST_TIME_ARGS (max_latency));
- /* the max samples we must buffer buffer */
+ /* the max samples we must buffer */
max_samples = MAX (VISUAL_SAMPLES, visual->spf);
our_latency =
- gst_util_uint64_scale_int (max_samples, GST_SECOND, visual->rate);
+ gst_util_uint64_scale_int (max_samples, GST_SECOND,
+ GST_AUDIO_INFO_RATE (&visual->info));
GST_DEBUG_OBJECT (visual, "Our latency: %" GST_TIME_FORMAT,
GST_TIME_ARGS (our_latency));
GstClockTime last_timestamp;
guint64 frame_nr;
gboolean need_keyframe;
- gint width, height;
+ GstVideoInfo vinfo;
+
gint offset_x, offset_y;
gint output_bpp;
+ GstBufferPool *pool;
+ gboolean use_cropping;
- /* telemetry debuging options */
+ /* telemetry debugging options */
gint telemetry_mv;
gint telemetry_mbmode;
gint telemetry_qi;
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
/**
* GstAppSink::new-preroll:
- * @appsink: the appsink element that emited the signal
+ * @appsink: the appsink element that emitted the signal
*
- * Signal that a new preroll buffer is available.
+ * Signal that a new preroll sample is available.
*
- * This signal is emited from the steaming thread and only when the
+ * This signal is emitted from the steaming thread and only when the
* "emit-signals" property is %TRUE.
*
- * The new preroll buffer can be retrieved with the "pull-preroll" action
+ * The new preroll sample can be retrieved with the "pull-preroll" action
* signal or gst_app_sink_pull_preroll() either from this signal callback
* or from any other thread.
*
G_STRUCT_OFFSET (GstAppSinkClass, new_preroll),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
/**
- * GstAppSink::new-buffer:
- * @appsink: the appsink element that emitted the signal
- *
- * Signal that a new buffer is available.
- *
- * This signal is emitted from the steaming thread and only when the
- * "emit-signals" property is %TRUE.
- *
- * The new buffer can be retrieved with the "pull-buffer" action
- * signal or gst_app_sink_pull_buffer() either from this signal callback
- * or from any other thread.
- *
- * Note that this signal is only emitted when the "emit-signals" property is
- * set to %TRUE, which it is not by default for performance reasons.
- */
- gst_app_sink_signals[SIGNAL_NEW_BUFFER] =
- g_signal_new ("new-buffer", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GstAppSinkClass, new_buffer),
- NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
- /**
- * GstAppSink::new-buffer-list:
- * @appsink: the appsink element that emitted the signal
+ * GstAppSink::new-sample:
+ * @appsink: the appsink element that emited the signal
*
- * Signal that a new bufferlist is available.
+ * Signal that a new sample is available.
*
- * This signal is emited from the steaming thread and only when the
+ * This signal is emitted from the steaming thread and only when the
* "emit-signals" property is %TRUE.
*
- * The new buffer can be retrieved with the "pull-buffer-list" action
- * signal or gst_app_sink_pull_buffer_list() either from this signal callback
+ * The new sample can be retrieved with the "pull-sample" action
+ * signal or gst_app_sink_pull_sample() either from this signal callback
* or from any other thread.
*
- * Note that this signal is only emited when the "emit-signals" property is
+ * Note that this signal is only emitted when the "emit-signals" property is
* set to %TRUE, which it is not by default for performance reasons.
*/
- gst_app_sink_signals[SIGNAL_NEW_BUFFER_LIST] =
- g_signal_new ("new-buffer-list", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, new_buffer_list),
+ gst_app_sink_signals[SIGNAL_NEW_SAMPLE] =
+ g_signal_new ("new-sample", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GstAppSinkClass, new_sample),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
/**
/**
* gst_audio_buffer_clip:
* @buffer: The buffer to clip.
- * @segment: Segment in %GST_FORMAT_TIME or %GST_FORMAT_DEFAULT to which the buffer should be clipped.
+ * @segment: Segment in %GST_FORMAT_TIME or %GST_FORMAT_DEFAULT to which
+ * the buffer should be clipped.
* @rate: sample rate.
- * @frame_size: size of one audio frame in bytes.
+ * @bpf: size of one audio frame in bytes. This is the size of one sample
+ * * channels.
*
- * Clip the the buffer to the given %GstSegment.
+ * Clip the buffer to the given %GstSegment.
*
- * After calling this function the caller does not own a reference to
+ * After calling this function the caller does not own a reference to
* @buffer anymore.
*
* Returns: %NULL if the buffer is completely outside the configured segment,
/* the running_time converted to a sample (relative to the ringbuffer) */
running_time_sample =
- gst_util_uint64_scale_int (running_time, spec->rate, GST_SECOND);
+ gst_util_uint64_scale_int (running_time, rate, GST_SECOND);
- /* the segmentnr corrensponding to running_time, round down */
+ /* the segmentnr corresponding to running_time, round down */
running_time_segment = running_time_sample / sps;
/* the segment currently read from the ringbuffer */
* GST_ENCODING_CATEGORY_DEVICE:
*
* #GstEncodingTarget category for device-specific targets.
- * The name of the target will usually be the contructor and model of the device,
+ * The name of the target will usually be the constructor and model of the device,
* and that target will contain #GstEncodingProfiles suitable for that device.
*/
-#define GST_ENCODING_CATEGORY_DEVICE "device"
+#define GST_ENCODING_CATEGORY_DEVICE "device"
/**
* GST_ENCODING_CATEGORY_ONLINE_SERVICE:
* - currently we just set rate as received from last seek-event
*
* When seeking we set the start and stop positions as given in the seek
- * event. We also adjust offset & timestamp acordingly.
+ * event. We also adjust offset & timestamp accordingly.
* This basically ignores all newsegments sent by upstream.
*/
- event = gst_event_new_new_segment_full (FALSE, adder->segment_rate,
- 1.0, GST_FORMAT_TIME, adder->segment_start, adder->segment_end,
- adder->segment_start);
- if (adder->segment_rate > 0.0) {
- adder->timestamp = adder->segment_start;
+ event = gst_event_new_segment (&adder->segment);
+
+ if (adder->segment.rate > 0.0) {
+ adder->segment.position = adder->segment.start;
} else {
- adder->timestamp = adder->segment_end;
+ adder->segment.position = adder->segment.stop;
}
- adder->offset = gst_util_uint64_scale (adder->timestamp,
- adder->rate, GST_SECOND);
+ adder->offset = gst_util_uint64_scale (adder->segment.position,
+ rate, GST_SECOND);
GST_INFO_OBJECT (adder, "seg_start %" G_GUINT64_FORMAT ", seg_end %"
- G_GUINT64_FORMAT, adder->segment_start, adder->segment_end);
+ G_GUINT64_FORMAT, adder->segment.start, adder->segment.stop);
GST_INFO_OBJECT (adder, "timestamp %" G_GINT64_FORMAT ",new offset %"
- G_GINT64_FORMAT, adder->timestamp, adder->offset);
+ G_GINT64_FORMAT, adder->segment.position, adder->offset);
if (event) {
if (!gst_pad_push_event (adder->srcpad, event)) {
enum
{
PROP_0,
- PROP_QUALITY,
- PROP_FILTER_LENGTH
+ PROP_QUALITY
};
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define SUPPORTED_CAPS \
-GST_STATIC_CAPS ( \
- "audio/x-raw-float, " \
- "rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, MAX ], " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) { 32, 64 }; " \
- "audio/x-raw-int, " \
- "rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, MAX ], " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) 32, " \
- "depth = (int) 32, " \
- "signed = (boolean) true; " \
- "audio/x-raw-int, " \
- "rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, MAX ], " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) 24, " \
- "depth = (int) 24, " \
- "signed = (boolean) true; " \
- "audio/x-raw-int, " \
- "rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, MAX ], " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) 16, " \
- "depth = (int) 16, " \
- "signed = (boolean) true; " \
- "audio/x-raw-int, " \
- "rate = (int) [ 1, MAX ], " \
- "channels = (int) [ 1, MAX ], " \
- "endianness = (int) BYTE_ORDER, " \
- "width = (int) 8, " \
- "depth = (int) 8, " \
- "signed = (boolean) true" \
-)
+ GST_AUDIO_CAPS_MAKE ("{ F32LE, F64LE, S32LE, S24LE, S16LE, S8 }")
+#else
+#define SUPPORTED_CAPS \
+ GST_AUDIO_CAPS_MAKE ("{ F32BE, F64BE, S32BE, S24BE, S16BE, S8 }")
+#endif
- /* If TRUE integer arithmetic resampling is faster and will be used if appropiate */
+ /* If TRUE integer arithmetic resampling is faster and will be used if appropriate */
#if defined AUDIORESAMPLE_FORMAT_INT
static gboolean gst_audio_resample_use_int = TRUE;
#elif defined AUDIORESAMPLE_FORMAT_FLOAT
* @caps: The #GstCaps.
* @factory: A #GstElementFactory to use.
*
- * This signal is emitted once decodebin2 has found all the possible
+ * This signal is emitted once decodebin has found all the possible
* #GstElementFactory that can be used to handle the given @caps. For each of
- * those factories, this signal is emited.
+ * those factories, this signal is emitted.
*
* The signal handler should return a #GST_TYPE_AUTOPLUG_SELECT_RESULT enum
- * value indicating what decodebin2 should do next.
+ * value indicating what decodebin should do next.
*
* A value of #GST_AUTOPLUG_SELECT_TRY will try to autoplug an element from
* @factory.
DEFAULT_HIGH_PERCENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
- * GstDecodebin2:max-size-bytes
+ * GstDecodeBin:max-size-bytes
*
- * Max amount amount of bytes in the queue (0=automatic).
+ * Max amount of bytes in the queue (0=automatic).
*
* Since: 0.10.26
*/
0, G_MAXUINT, DEFAULT_MAX_SIZE_BYTES,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
- * GstDecodebin2:max-size-buffers
+ * GstDecodeBin:max-size-buffers
*
- * Max amount amount of buffers in the queue (0=automatic).
+ * Max amount of buffers in the queue (0=automatic).
*
* Since: 0.10.26
*/
0, G_MAXUINT, DEFAULT_MAX_SIZE_BUFFERS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
- * GstDecodebin2:max-size-time
+ * GstDecodeBin:max-size-time
*
- * Max amount amount of time in the queue (in ns, 0=automatic).
+ * Max amount of time in the queue (in ns, 0=automatic).
*
* Since: 0.10.26
*/
*
* This signal is emitted once uridecodebin has found all the possible
* #GstElementFactory that can be used to handle the given @caps. For each of
- * those factories, this signal is emited.
+ * those factories, this signal is emitted.
*
* The signal handler should return a #GST_TYPE_AUTOPLUG_SELECT_RESULT enum
- * value indicating what decodebin2 should do next.
+ * value indicating what decodebin should do next.
*
* A value of #GST_AUTOPLUG_SELECT_TRY will try to autoplug an element from
* @factory.
ctx->out_buffer_count++;
if (ctx->latency == GST_CLOCK_TIME_NONE) {
- ctx->latency = 1000 - GST_BUFFER_SIZE (buffer) / 8;
+ ctx->latency = 1000 - gst_buffer_get_size (buffer) / 8;
}
- /* Check if we have a perfectly timestampped stream */
+ /* Check if we have a perfectly timestamped stream */
if (ctx->next_out_ts != GST_CLOCK_TIME_NONE)
fail_unless (ctx->next_out_ts == GST_BUFFER_TIMESTAMP (buffer),
"expected timestamp %" GST_TIME_FORMAT " got timestamp %"