本文整理汇总了C++中GST_EVENT_TYPE_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_EVENT_TYPE_NAME函数的具体用法?C++ GST_EVENT_TYPE_NAME怎么用?C++ GST_EVENT_TYPE_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GST_EVENT_TYPE_NAME函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: opus_dec_src_event
static gboolean
opus_dec_src_event (GstPad * pad, GstEvent * event)
{
gboolean res = FALSE;
GstOpusDec *dec = GST_OPUS_DEC (gst_pad_get_parent (pad));
GST_LOG_OBJECT (dec, "handling %s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEEK:{
GstFormat format, tformat;
gdouble rate;
GstEvent *real_seek;
GstSeekFlags flags;
GstSeekType cur_type, stop_type;
gint64 cur, stop;
gint64 tcur, tstop;
gst_event_parse_seek (event, &rate, &format, &flags, &cur_type, &cur,
&stop_type, &stop);
/* we have to ask our peer to seek to time here as we know
* nothing about how to generate a granulepos from the src
* formats or anything.
*
* First bring the requested format to time
*/
tformat = GST_FORMAT_TIME;
if (!(res = opus_dec_convert (pad, format, cur, &tformat, &tcur)))
break;
if (!(res = opus_dec_convert (pad, format, stop, &tformat, &tstop)))
break;
/* then seek with time on the peer */
real_seek = gst_event_new_seek (rate, GST_FORMAT_TIME,
flags, cur_type, tcur, stop_type, tstop);
GST_LOG_OBJECT (dec, "seek to %" GST_TIME_FORMAT, GST_TIME_ARGS (tcur));
res = gst_pad_push_event (dec->sinkpad, real_seek);
gst_event_unref (event);
break;
}
default:
res = gst_pad_event_default (pad, event);
break;
}
gst_object_unref (dec);
return res;
}
示例2: gst_gnome_vfs_sink_handle_event
static gboolean
gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink, GstEvent * event)
{
GstGnomeVFSSink *sink;
gboolean ret = TRUE;
sink = GST_GNOME_VFS_SINK (basesink);
GST_DEBUG_OBJECT (sink, "processing %s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT: {
GnomeVFSResult res;
GstFormat format;
gint64 offset;
gst_event_parse_new_segment (event, NULL, NULL, &format, &offset,
NULL, NULL);
if (format != GST_FORMAT_BYTES) {
GST_WARNING_OBJECT (sink, "ignored NEWSEGMENT event in %s format",
gst_format_get_name (format));
break;
}
GST_LOG_OBJECT (sink, "seeking to offset %" G_GINT64_FORMAT, offset);
res = gnome_vfs_seek (sink->handle, GNOME_VFS_SEEK_START, offset);
if (res != GNOME_VFS_OK) {
GST_ERROR_OBJECT (sink, "Failed to seek to offset %"
G_GINT64_FORMAT ": %s", offset, gnome_vfs_result_to_string (res));
ret = FALSE;
} else {
sink->current_pos = offset;
}
break;
}
case GST_EVENT_FLUSH_START:
case GST_EVENT_EOS: {
/* No need to flush with GnomeVfs */
break;
}
default:
break;
}
return ret;
}
示例3: gst_android_video_source_event
/* Event */
static gboolean gst_android_video_source_event(GstBaseSrc * p_gstbasesrc, GstEvent * p_event)
{
gboolean res = TRUE;
GA_LOGTRACE("ENTER %s --xx--> thread(%ld)", __FUNCTION__, pthread_self());
const char* event_name_str = GST_EVENT_TYPE_NAME(p_event);
GA_LOGVERB("%s: Received event: %s", __FUNCTION__, event_name_str);
// Currently doing nothing here...
GA_LOGTRACE("EXIT %s", __FUNCTION__);
return res;
}
示例4: gst_shout2send_event
static gboolean
gst_shout2send_event (GstBaseSink * sink, GstEvent * event)
{
GstShout2send *shout2send;
gboolean ret = TRUE;
shout2send = GST_SHOUT2SEND (sink);
GST_LOG_OBJECT (shout2send, "got %s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_TAG:{
/* vorbis audio doesnt need metadata setting on the icecast level, only mp3 */
if (shout2send->tags && shout2send->audio_format == SHOUT_FORMAT_MP3) {
GstTagList *list;
gst_event_parse_tag (event, &list);
GST_DEBUG_OBJECT (shout2send, "tags=%" GST_PTR_FORMAT, list);
gst_tag_list_insert (shout2send->tags,
list,
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (shout2send)));
/* lets get the artist and song tags */
gst_tag_list_foreach ((GstTagList *) list,
set_shout_metadata, shout2send);
if (shout2send->songmetadata && shout2send->connected) {
shout_metadata_t *pmetadata;
GST_DEBUG_OBJECT (shout2send, "metadata now: %s",
shout2send->songmetadata);
pmetadata = shout_metadata_new ();
shout_metadata_add (pmetadata, "song", shout2send->songmetadata);
shout_set_metadata (shout2send->conn, pmetadata);
shout_metadata_free (pmetadata);
}
}
break;
}
default:{
GST_LOG_OBJECT (shout2send, "let base class handle event");
if (GST_BASE_SINK_CLASS (parent_class)->event) {
event = gst_event_ref (event);
ret = GST_BASE_SINK_CLASS (parent_class)->event (sink, event);
}
break;
}
}
return ret;
}
示例5: forward_sticky_events
static gboolean
forward_sticky_events (GstPad * pad, GstEvent ** event, gpointer user_data)
{
GstPad *srcpad = GST_PAD_CAST (user_data);
GstFlowReturn ret;
ret = gst_pad_store_sticky_event (srcpad, *event);
if (ret != GST_FLOW_OK) {
GST_DEBUG_OBJECT (srcpad, "storing sticky event %p (%s) failed: %s", *event,
GST_EVENT_TYPE_NAME (*event), gst_flow_get_name (ret));
}
return TRUE;
}
示例6: gst_base_video_encoder_sink_event
static gboolean
gst_base_video_encoder_sink_event (GstPad * pad, GstEvent * event)
{
GstBaseVideoEncoder *enc;
GstBaseVideoEncoderClass *klass;
gboolean handled = FALSE;
gboolean ret = TRUE;
enc = GST_BASE_VIDEO_ENCODER (gst_pad_get_parent (pad));
klass = GST_BASE_VIDEO_ENCODER_GET_CLASS (enc);
GST_DEBUG_OBJECT (enc, "received event %d, %s", GST_EVENT_TYPE (event),
GST_EVENT_TYPE_NAME (event));
if (klass->event)
handled = klass->event (enc, event);
if (!handled)
handled = gst_base_video_encoder_sink_eventfunc (enc, event);
if (!handled) {
/* Forward non-serialized events and EOS/FLUSH_STOP immediately.
* For EOS this is required because no buffer or serialized event
* will come after EOS and nothing could trigger another
* _finish_frame() call. *
* If the subclass handles sending of EOS manually it can return
* _DROPPED from ::finish() and all other subclasses should have
* decoded/flushed all remaining data before this
*
* For FLUSH_STOP this is required because it is expected
* to be forwarded immediately and no buffers are queued anyway.
*/
if (!GST_EVENT_IS_SERIALIZED (event)
|| GST_EVENT_TYPE (event) == GST_EVENT_EOS
|| GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) {
ret = gst_pad_push_event (enc->base_video_codec.srcpad, event);
} else {
GST_BASE_VIDEO_CODEC_STREAM_LOCK (enc);
enc->current_frame_events =
g_list_prepend (enc->current_frame_events, event);
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (enc);
}
}
GST_DEBUG_OBJECT (enc, "event handled");
gst_object_unref (enc);
return ret;
}
示例7: gst_span_plc_event_sink
static gboolean
gst_span_plc_event_sink (GstPad * pad, GstEvent * event)
{
gboolean ret = FALSE;
GstSpanPlc *plc = GST_SPAN_PLC (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (plc, "received event %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT:
{
GstFormat format;
gdouble rate;
gint64 start, stop, time;
gboolean update;
gst_event_parse_new_segment (event, &update, &rate, &format, &start,
&stop, &time);
if (format != GST_FORMAT_TIME)
goto newseg_wrong_format;
if (update) {
/* time progressed without data, see if we can fill the gap with
* some concealment data */
if (plc->last_stop < start)
gst_span_plc_send_fillin (plc, start - plc->last_stop);
}
plc->last_stop = start;
break;
}
case GST_EVENT_FLUSH_START:
gst_span_plc_flush (plc, TRUE);
break;
default:
break;
}
ret = gst_pad_push_event (plc->srcpad, event);
gst_object_unref (plc);
return ret;
newseg_wrong_format:
{
GST_DEBUG_OBJECT (plc, "received non TIME newsegment");
gst_object_unref (plc);
return FALSE;
}
}
示例8: gst_jp2k_decimator_event
static gboolean
gst_jp2k_decimator_event (GstPad * pad, GstEvent * event)
{
GstJP2kDecimator *self = GST_JP2K_DECIMATOR (gst_pad_get_parent (pad));
GstPad *otherpad;
gboolean ret;
GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
otherpad = (pad == self->srcpad) ? self->sinkpad : self->srcpad;
ret = gst_pad_push_event (otherpad, event);
gst_object_unref (self);
return ret;
}
示例9: gst_type_find_element_send_cached_events
static void
gst_type_find_element_send_cached_events (GstTypeFindElement * typefind)
{
GList *l;
for (l = typefind->cached_events; l != NULL; l = l->next) {
GstEvent *event = GST_EVENT (l->data);
GST_DEBUG_OBJECT (typefind, "sending cached %s event",
GST_EVENT_TYPE_NAME (event));
gst_pad_push_event (typefind->src, event);
}
g_list_free (typefind->cached_events);
typefind->cached_events = NULL;
}
示例10: forward_event_func
static gboolean
forward_event_func (GstPad * pad, GValue * ret, EventData * data)
{
GstEvent *event = data->event;
gst_event_ref (event);
GST_LOG_OBJECT (pad, "About to send event %s", GST_EVENT_TYPE_NAME (event));
if (!gst_pad_push_event (pad, event)) {
GST_WARNING_OBJECT (pad, "Sending event %p (%s) failed.",
event, GST_EVENT_TYPE_NAME (event));
/* quick hack to unflush the pads, ideally we need a way to just unflush
* this single collect pad */
if (data->flush)
gst_pad_send_event (pad, gst_event_new_flush_stop ());
} else {
g_value_set_boolean (ret, TRUE);
GST_LOG_OBJECT (pad, "Sent event %p (%s).",
event, GST_EVENT_TYPE_NAME (event));
}
gst_object_unref (pad);
/* continue on other pads, even if one failed */
return TRUE;
}
示例11: gst_adder_sink_event
static gboolean
gst_adder_sink_event (GstPad * pad, GstEvent * event)
{
GstAdder *adder;
gboolean ret = TRUE;
adder = GST_ADDER (gst_pad_get_parent (pad));
GST_DEBUG ("Got %s event on pad %s:%s", GST_EVENT_TYPE_NAME (event),
GST_DEBUG_PAD_NAME (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_STOP:
/* we received a flush-stop. The collect_event function will push the
* event past our element. We simply forward all flush-stop events, even
* when no flush-stop was pending, this is required because collectpads
* does not provide an API to handle-but-not-forward the flush-stop.
* We unset the pending flush-stop flag so that we don't send anymore
* flush-stop from the collect function later.
*/
GST_OBJECT_LOCK (adder->collect);
adder->segment_pending = TRUE;
adder->flush_stop_pending = FALSE;
/* Clear pending tags */
if (adder->pending_events) {
g_list_foreach (adder->pending_events, (GFunc) gst_event_unref, NULL);
g_list_free (adder->pending_events);
adder->pending_events = NULL;
}
GST_OBJECT_UNLOCK (adder->collect);
break;
case GST_EVENT_TAG:
GST_OBJECT_LOCK (adder->collect);
/* collect tags here so we can push them out when we collect data */
adder->pending_events = g_list_append (adder->pending_events, event);
GST_OBJECT_UNLOCK (adder->collect);
goto beach;
default:
break;
}
/* now GstCollectPads can take care of the rest, e.g. EOS */
ret = adder->collect_event (pad, event);
beach:
gst_object_unref (adder);
return ret;
}
示例12: do_push_event_pre
static void
do_push_event_pre (GstStatsTracer * self, guint64 ts, GstPad * pad,
GstEvent * ev)
{
GstElement *elem = get_real_pad_parent (pad);
GstElementStats *elem_stats = get_element_stats (self, elem);
GstPadStats *pad_stats = get_pad_stats (self, pad);
elem_stats->last_ts = ts;
gst_tracer_log_trace (gst_structure_new ("event",
"thread-id", G_TYPE_UINT, GPOINTER_TO_UINT (g_thread_self ()),
"ts", G_TYPE_UINT64, ts,
"pad-ix", G_TYPE_UINT, pad_stats->index,
"elem-ix", G_TYPE_UINT, elem_stats->index,
"name", G_TYPE_STRING, GST_EVENT_TYPE_NAME (ev), NULL));
}
示例13: gst_rrparser_sink_event
static gboolean gst_rrparser_sink_event(GstPad *pad, GstEvent *event)
{
GstRRParser * rrparser =(GstRRParser *) gst_pad_get_parent(pad);
gboolean ret = FALSE;
GST_DEBUG("pad \"%s\" received: %s\n", GST_PAD_NAME(pad),
GST_EVENT_TYPE_NAME(event));
switch (GST_EVENT_TYPE(event)) {
case GST_EVENT_EOS:
ret = gst_pad_push_event(rrparser->src_pad, event);
break;
default:
ret = gst_pad_push_event(rrparser->src_pad, event);
}
return ret;
}
示例14: handle_event
static gboolean
handle_event (GstBaseSink *gst_base,
GstEvent *event)
{
GstOmxBaseSink *self;
GOmxCore *gomx;
GOmxPort *in_port;
self = GST_OMX_BASE_SINK (gst_base);
gomx = self->gomx;
in_port = self->in_port;
GST_LOG_OBJECT (self, "begin");
GST_DEBUG_OBJECT (self, "event: %s", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event))
{
case GST_EVENT_EOS:
/* Close the inpurt port. */
g_omx_core_set_done (gomx);
break;
case GST_EVENT_FLUSH_START:
/* unlock loops */
g_omx_port_pause (in_port);
/* flush all buffers */
OMX_SendCommand (gomx->omx_handle, OMX_CommandFlush, OMX_ALL, NULL);
break;
case GST_EVENT_FLUSH_STOP:
g_sem_down (gomx->flush_sem);
g_omx_port_resume (in_port);
break;
default:
break;
}
GST_LOG_OBJECT (self, "end");
return TRUE;
}
示例15: gst_fluid_dec_sink_event
static gboolean
gst_fluid_dec_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
{
gboolean res;
GstFluidDec *fluiddec = GST_FLUID_DEC (parent);
GST_DEBUG_OBJECT (pad, "%s event received", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
{
GstCaps *caps;
caps = gst_caps_new_simple ("audio/x-raw",
"format", G_TYPE_STRING, GST_AUDIO_NE (F32),
"rate", G_TYPE_INT, FLUID_DEC_RATE,
"channels", G_TYPE_INT, 2,
"layout", G_TYPE_STRING, "interleaved", NULL);
fluid_synth_set_sample_rate (fluiddec->synth, FLUID_DEC_RATE);
res = gst_pad_push_event (fluiddec->srcpad, gst_event_new_caps (caps));
gst_caps_unref (caps);
break;
}
case GST_EVENT_SEGMENT:
gst_event_copy_segment (event, &fluiddec->segment);
GST_DEBUG_OBJECT (fluiddec, "configured segment %" GST_SEGMENT_FORMAT,
&fluiddec->segment);
res = gst_pad_event_default (pad, parent, event);
break;
case GST_EVENT_FLUSH_STOP:
gst_fluid_dec_reset (fluiddec);
res = gst_pad_event_default (pad, parent, event);
break;
case GST_EVENT_EOS:
/* FIXME, push last samples */
res = gst_pad_event_default (pad, parent, event);
break;
default:
res = gst_pad_event_default (pad, parent, event);
break;
}
return res;
}