您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GST_MESSAGE_SRC函数代码示例

51自学网 2021-06-01 20:56:41
  C++
这篇教程C++ GST_MESSAGE_SRC函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GST_MESSAGE_SRC函数的典型用法代码示例。如果您正苦于以下问题:C++ GST_MESSAGE_SRC函数的具体用法?C++ GST_MESSAGE_SRC怎么用?C++ GST_MESSAGE_SRC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GST_MESSAGE_SRC函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: create_window

static GstBusSyncReplycreate_window(GstBus *bus, GstMessage *msg, gpointer data){    preview_t *preview = (preview_t*)data;    switch (GST_MESSAGE_TYPE(msg))    {    case GST_MESSAGE_ELEMENT:    {#if GST_CHECK_VERSION(1, 0, 0)        if (!gst_is_video_overlay_prepare_window_handle_message(msg))            return GST_BUS_PASS;        gst_video_overlay_set_window_handle(            GST_VIDEO_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);#else        if (!gst_structure_has_name(msg->structure, "prepare-xwindow-id"))            return GST_BUS_PASS;#if !defined(_WIN32)        gst_x_overlay_set_xwindow_id(            GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);#else        gst_directdraw_sink_set_window_id(            GST_X_OVERLAY(GST_MESSAGE_SRC(msg)), preview->xid);#endif#endif        gst_message_unref(msg);        return GST_BUS_DROP;    } break;    default:    {    } break;    }    return GST_BUS_PASS;}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:35,


示例2: create_window

static GstBusSyncReply create_window (GstBus* bus, GstMessage* message, GtkWidget* widget){    GtkAllocation allocation;    if (gst_gtk_handle_need_context (bus, message, NULL))        return GST_BUS_DROP;    // ignore anything but 'prepare-window-handle' element messages    if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)        return GST_BUS_PASS;    if (!gst_is_video_overlay_prepare_window_handle_message (message))        return GST_BUS_PASS;    g_print ("setting window handle %p/n", widget);    gst_video_overlay_set_gtk_window (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)), widget);    gtk_widget_get_allocation (widget, &allocation);    gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)), allocation.x, allocation.y, allocation.width, allocation.height);    gst_message_unref (message);    return GST_BUS_DROP;}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-bad,代码行数:25,


示例3: message_received

static voidmessage_received (GstBus * bus, GstMessage * message, GstPipeline * bin){  GST_INFO ("bus message from /"%" GST_PTR_FORMAT "/": %" GST_PTR_FORMAT,      GST_MESSAGE_SRC (message), message);  switch (message->type) {    case GST_MESSAGE_EOS:      g_main_loop_quit (main_loop);      break;    case GST_MESSAGE_WARNING:{      GError *gerror;      gchar *debug;      gst_message_parse_warning (message, &gerror, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);      g_error_free (gerror);      g_free (debug);      break;    }    case GST_MESSAGE_ERROR:{      GError *gerror;      gchar *debug;      gst_message_parse_error (message, &gerror, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);      g_error_free (gerror);      g_free (debug);      g_main_loop_quit (main_loop);      break;    }    default:      break;  }}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-base,代码行数:35,


示例4: _test_reverse_negotiation_message

static void_test_reverse_negotiation_message (GstBus * bus, GstMessage * message,    GMainLoop * loop){  GError *err = NULL;  gchar *debug;  switch (GST_MESSAGE_TYPE (message)) {    case GST_MESSAGE_ERROR:      gst_message_parse_error (message, &err, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), err, debug);      g_error_free (err);      g_free (debug);      g_assert_not_reached ();      break;    case GST_MESSAGE_WARNING:      gst_message_parse_warning (message, &err, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), err, debug);      g_error_free (err);      g_free (debug);      g_assert_not_reached ();      break;    case GST_MESSAGE_EOS:      g_main_loop_quit (loop);      break;    default:      break;  }}
开发者ID:rawoul,项目名称:gst-plugins-base,代码行数:29,


示例5: bus_callback

static gbooleanbus_callback (GstBus * bus, GstMessage * message, gpointer data){  switch (GST_MESSAGE_TYPE (message)) {    case GST_MESSAGE_ERROR:{      GError *err;      gchar *debug;      gst_message_parse_error (message, &err, &debug);      g_print ("Error: %s/n", err->message);      g_error_free (err);      g_free (debug);      /* Write debug graph to file */      GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (camerabin),          GST_DEBUG_GRAPH_SHOW_ALL, "camerabin.error");      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_STATE_CHANGED:      if (GST_IS_BIN (GST_MESSAGE_SRC (message))) {        GstState oldstate, newstate;        gst_message_parse_state_changed (message, &oldstate, &newstate, NULL);        GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), "state-changed: %s -> %s",            gst_element_state_get_name (oldstate),            gst_element_state_get_name (newstate));      }      break;    case GST_MESSAGE_EOS:      /* end-of-stream */      GST_INFO ("got eos() - should not happen");      g_main_loop_quit (loop);      break;    case GST_MESSAGE_ELEMENT:      if (GST_MESSAGE_SRC (message) == (GstObject *) camerabin) {        const GstStructure *structure = gst_message_get_structure (message);        if (gst_structure_has_name (structure, "image-done")) {#ifndef GST_DISABLE_GST_DEBUG          const gchar *fname = gst_structure_get_string (structure, "filename");          GST_DEBUG ("image done: %s", fname);#endif          if (capture_count < capture_total) {            g_idle_add ((GSourceFunc) run_pipeline, NULL);          } else {            g_main_loop_quit (loop);          }        }      }      break;    default:      /* unhandled message */      break;  }  return TRUE;}
开发者ID:mrchapp,项目名称:gst-plugins-bad,代码行数:59,


示例6: default_msg_handler

static bool default_msg_handler( decoder_t *p_dec, GstMessage *p_msg ){    bool err = false;    switch( GST_MESSAGE_TYPE( p_msg ) ){    case GST_MESSAGE_ERROR:        {            gchar  *psz_debug;            GError *p_error;            gst_message_parse_error( p_msg, &p_error, &psz_debug );            g_free( psz_debug );            msg_Err( p_dec, "Error from %s: %s",                    GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),                    p_error->message );            g_error_free( p_error );            err = true;        }        break;    case GST_MESSAGE_WARNING:        {            gchar  *psz_debug;            GError *p_error;            gst_message_parse_warning( p_msg, &p_error, &psz_debug );            g_free( psz_debug );            msg_Warn( p_dec, "Warning from %s: %s",                    GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),                    p_error->message );            g_error_free( p_error );        }        break;    case GST_MESSAGE_INFO:        {            gchar  *psz_debug;            GError *p_error;            gst_message_parse_info( p_msg, &p_error, &psz_debug );            g_free( psz_debug );            msg_Info( p_dec, "Info from %s: %s",                    GST_ELEMENT_NAME( GST_MESSAGE_SRC( p_msg ) ),                    p_error->message );            g_error_free( p_error );        }        break;    default:        break;    }    return err;}
开发者ID:CityFire,项目名称:vlc,代码行数:54,


示例7: message_received

static voidmessage_received (GstBus * bus, GstMessage * message, gpointer user_data){  if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) {    GST_WARNING_OBJECT (GST_MESSAGE_SRC (message), "error: %" GST_PTR_FORMAT,        message);  } else {    GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message), "eos: %" GST_PTR_FORMAT,        message);  }  g_main_loop_quit (user_data);}
开发者ID:Buzztrax,项目名称:buzztrax,代码行数:12,


示例8: typefind_message_received

static voidtypefind_message_received (GstBus * bus, GstMessage * message,    gpointer user_data){  if (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ERROR) {    GST_WARNING_OBJECT (GST_MESSAGE_SRC (message),        "error for '%s': %" GST_PTR_FORMAT, (gchar *) user_data, message);  } else {    GST_DEBUG_OBJECT (GST_MESSAGE_SRC (message),        "eos for '%s': %" GST_PTR_FORMAT, (gchar *) user_data, message);  }  g_main_loop_quit (typefind_main_loop);}
开发者ID:Buzztrax,项目名称:buzztrax,代码行数:13,


示例9: ges_validate_handle_request_state_change

voidges_validate_handle_request_state_change (GstMessage * message,    GApplication * application){  GstState state;  gst_message_parse_request_state (message, &state);  if (GST_IS_VALIDATE_SCENARIO (GST_MESSAGE_SRC (message))      && state == GST_STATE_NULL) {    gst_validate_printf (GST_MESSAGE_SRC (message),        "State change request NULL, " "quiting application/n");    g_application_quit (application);  }}
开发者ID:GStreamer,项目名称:gst-editing-services,代码行数:15,


示例10: create_window

static GstBusSyncReplycreate_window (GstBus * bus, GstMessage * message, gpointer data){  GstGLClutterActor **actor = (GstGLClutterActor **) data;  static gint count = 0;  static GMutex mutex;  // ignore anything but 'prepare-window-handle' element messages  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)    return GST_BUS_PASS;  if (!gst_is_video_overlay_prepare_window_handle_message (message))    return GST_BUS_PASS;  g_mutex_lock (&mutex);  if (count < N_ACTORS) {    g_message ("adding actor %d", count);    gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC            (message)), actor[count]->win);    clutter_threads_add_idle ((GSourceFunc) create_actor, actor[count]);    count++;  }  g_mutex_unlock (&mutex);  gst_message_unref (message);  return GST_BUS_DROP;}
开发者ID:ConfusedReality,项目名称:pkg_multimedia_gst-plugins-bad,代码行数:28,


示例11: handle_message

static gbooleanhandle_message (GstBus * bus, GstMessage * message, gpointer data){  GstElement *bin = GST_ELEMENT_CAST (data);  switch (message->type) {    case GST_MESSAGE_EOS:      g_message ("got EOS");      g_main_loop_quit (loop);      break;    case GST_MESSAGE_WARNING:    case GST_MESSAGE_ERROR:    {      GError *gerror;      gchar *debug;      if (message->type == GST_MESSAGE_ERROR)        gst_message_parse_error (message, &gerror, &debug);      else        gst_message_parse_warning (message, &gerror, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);      g_error_free (gerror);      g_free (debug);      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_ASYNC_DONE:      g_timeout_add (40, (GSourceFunc) do_step, bin);      break;    default:      break;  }  return TRUE;}
开发者ID:GrokImageCompression,项目名称:gst-plugins-base,代码行数:35,


示例12: pointerDetector_receive_message

voidpointerDetector_receive_message (GstBus *bus, GstMessage *message, gpointer pointerDetector){  const GstStructure *st;  gchar *windowID;  const gchar *type;  std::string windowIDStr, typeStr;  PointerDetectorFilter *filter = (PointerDetectorFilter *) pointerDetector;  if (GST_MESSAGE_SRC (message) != GST_OBJECT (filter->pointerDetector) ||      GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)    return;  st = gst_message_get_structure (message);  type = gst_structure_get_name (st);  if ( (g_strcmp0 (type, "window-out") != 0) &&       (g_strcmp0 (type, "window-in") != 0) ) {    GST_WARNING ("The message does not have the correct name");    return;  }  if (!gst_structure_get (st, "window", G_TYPE_STRING , &windowID, NULL) ) {    GST_WARNING ("The message does not contain the window ID");    return;  }  windowIDStr = windowID;  typeStr = type;  g_free (windowID);  filter->raiseEvent (typeStr, windowIDStr);}
开发者ID:sgala,项目名称:kurento-media-server,代码行数:35,


示例13: my_bus_callback

static gbooleanmy_bus_callback (GstBus * bus, GstMessage * message, gpointer data){  GstElement *sender = (GstElement *) GST_MESSAGE_SRC (message);  const gchar *name = gst_element_get_name (sender);  GMainLoop *loop = (GMainLoop *) data;  g_print ("Got %s message from %s/n", GST_MESSAGE_TYPE_NAME (message), name);  switch (GST_MESSAGE_TYPE (message)) {    case GST_MESSAGE_ERROR:{      GError *err;      gchar *debug;      gst_message_parse_error (message, &err, &debug);      g_print ("Error: %s (%s)/n", err->message, debug);      g_error_free (err);      g_free (debug);      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_EOS:      /* end-of-stream */      g_main_loop_quit (loop);      break;    default:      /* unhandled message */      break;  }  return TRUE;}
开发者ID:ChinnaSuhas,项目名称:ossbuild,代码行数:34,


示例14: BufferingMessageReceived

void GstEnginePipeline::BufferingMessageReceived(GstMessage* msg) {    // Only handle buffering messages from the queue2 element in audiobin - not    // the one that's created automatically by uridecodebin.    if (GST_ELEMENT(GST_MESSAGE_SRC(msg)) != queue_) {        return;    }    // If we are loading new next track, we don't have to pause the playback.    // The buffering is for the next track and not the current one.    if (emit_track_ended_on_stream_start_) {        qLog(Debug) << "Buffering next track";        return;    }    int percent = 0;    gst_message_parse_buffering(msg, &percent);    const GstState current_state = state();    if (percent == 0 && current_state == GST_STATE_PLAYING && !buffering_) {        buffering_ = true;        emit BufferingStarted();        SetState(GST_STATE_PAUSED);    } else if (percent == 100 && buffering_) {        buffering_ = false;        emit BufferingFinished();        SetState(GST_STATE_PLAYING);    } else if (buffering_) {        emit BufferingProgress(percent);    }}
开发者ID:redyoshi49q,项目名称:Clementine,代码行数:33,


示例15: busMessage

void ZBarFilterImpl::busMessage (GstMessage *message){  if (GST_MESSAGE_SRC (message) == GST_OBJECT (zbar) &&      GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) {    const GstStructure *st;    guint64 ts;    gchar *type, *symbol;    st = gst_message_get_structure (message);    if (g_strcmp0 (gst_structure_get_name (st), "barcode") != 0) {      return;    }    if (!gst_structure_get (st, "timestamp", G_TYPE_UINT64, &ts,                            "type", G_TYPE_STRING, &type, "symbol",                            G_TYPE_STRING, &symbol, NULL) ) {      return;    }    std::string symbolStr (symbol);    std::string typeStr (type);    g_free (type);    g_free (symbol);    barcodeDetected (ts, typeStr, symbolStr);  }}
开发者ID:kirushyk,项目名称:kms-filters,代码行数:30,


示例16: _bus_stop_stream_cb

static gboolean_bus_stop_stream_cb (GstBus *bus, GstMessage *message, gpointer user_data){  FsStreamTransmitter *st = user_data;  GstState oldstate, newstate, pending;  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_STATE_CHANGED ||      G_OBJECT_TYPE (GST_MESSAGE_SRC (message)) != GST_TYPE_PIPELINE)    return bus_error_callback (bus, message, user_data);  gst_message_parse_state_changed (message, &oldstate, &newstate, &pending);  if (newstate != GST_STATE_PLAYING)    return TRUE;  if (pending != GST_STATE_VOID_PENDING)    ts_fail ("New state playing, but pending is %d", pending);  GST_DEBUG ("Stopping stream transmitter");  fs_stream_transmitter_stop (st);  g_object_unref (st);  GST_DEBUG ("Stopped stream transmitter");  g_atomic_int_set(&running, FALSE);  g_main_loop_quit (loop);  return TRUE;}
开发者ID:pexip,项目名称:farstream,代码行数:30,


示例17: event_loop

static voidevent_loop (GstElement * pipe){  GstBus *bus;  GstMessage *message = NULL;  bus = gst_element_get_bus (GST_ELEMENT (pipe));  while (TRUE) {    message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);    g_assert (message != NULL);    switch (message->type) {      case GST_MESSAGE_EOS:        gst_message_unref (message);        return;      case GST_MESSAGE_WARNING:      case GST_MESSAGE_ERROR:{        GError *gerror;        gchar *debug;        gst_message_parse_error (message, &gerror, &debug);        gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);        gst_message_unref (message);        g_error_free (gerror);        g_free (debug);        return;      }      default:        gst_message_unref (message);        break;    }  }}
开发者ID:genesi,项目名称:gstreamer,代码行数:35,


示例18: bus_handler

static gbooleanbus_handler (GstBus * bus, GstMessage * message, gpointer data){  GMainLoop *loop = (GMainLoop *) data;  switch (message->type) {    case GST_MESSAGE_EOS:      g_main_loop_quit (loop);      break;    case GST_MESSAGE_WARNING:    case GST_MESSAGE_ERROR:{      GError *gerror;      gchar *debug;      if (message->type == GST_MESSAGE_WARNING)        gst_message_parse_warning (message, &gerror, &debug);      else        gst_message_parse_error (message, &gerror, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);      gst_message_unref (message);      g_error_free (gerror);      g_free (debug);      g_main_loop_quit (loop);      break;    }    default:      break;  }  return TRUE;}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:31,


示例19: sync_bus_callback

static GstBusSyncReplysync_bus_callback (GstBus * bus, GstMessage * message, gpointer data){  const GstStructure *st;  const GValue *image;  GstBuffer *buf = NULL;  guint8 *data_buf = NULL;  gchar *caps_string;  guint size = 0;  gchar *preview_filename = NULL;  FILE *f = NULL;  size_t written;  switch (GST_MESSAGE_TYPE (message)) {    case GST_MESSAGE_ELEMENT:{      st = gst_message_get_structure (message);      if (st) {        if (gst_structure_has_name (message->structure, "prepare-xwindow-id")) {          if (!no_xwindow && window) {            gst_x_overlay_set_window_handle (GST_X_OVERLAY (GST_MESSAGE_SRC                    (message)), window);            gst_message_unref (message);            message = NULL;            return GST_BUS_DROP;          }        } else if (gst_structure_has_name (st, "preview-image")) {          GST_DEBUG ("preview-image");          /* extract preview-image from msg */          image = gst_structure_get_value (st, "buffer");          if (image) {            buf = gst_value_get_buffer (image);            data_buf = GST_BUFFER_DATA (buf);            size = GST_BUFFER_SIZE (buf);            preview_filename = g_strdup_printf ("test_vga.rgb");            caps_string = gst_caps_to_string (GST_BUFFER_CAPS (buf));            g_print ("writing buffer to %s, elapsed: %.2fs, buffer caps: %s/n",                preview_filename, g_timer_elapsed (timer, NULL), caps_string);            g_free (caps_string);            f = g_fopen (preview_filename, "w");            if (f) {              written = fwrite (data_buf, size, 1, f);              if (!written) {                g_print ("error writing file/n");              }              fclose (f);            } else {              g_print ("error opening file for raw image writing/n");            }            g_free (preview_filename);          }        }      }      break;    }    default:      /* unhandled message */      break;  }  return GST_BUS_PASS;}
开发者ID:mrchapp,项目名称:gst-plugins-bad,代码行数:60,


示例20: handle_message

/* Process messages from GStreamer */static gboolean handle_message (GstBus *bus, GstMessage *msg, CustomData *data) {    GError *err;    gchar *debug_info;    switch (GST_MESSAGE_TYPE (msg)) {    case GST_MESSAGE_ERROR:        gst_message_parse_error (msg, &err, &debug_info);        g_printerr ("Error received from element %s: %s/n", GST_OBJECT_NAME (msg->src), err->message);        g_printerr ("Debugging information: %s/n", debug_info ? debug_info : "none");        g_clear_error (&err);        g_free (debug_info);        g_main_loop_quit (data->main_loop);        break;    case GST_MESSAGE_EOS:        g_print ("End-Of-Stream reached./n");        g_main_loop_quit (data->main_loop);        break;    case GST_MESSAGE_STATE_CHANGED: {        GstState old_state, new_state, pending_state;        gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);        if (GST_MESSAGE_SRC (msg) == GST_OBJECT (data->playbin2)) {            if (new_state == GST_STATE_PLAYING) {                /* Once we are in the playing state, analyze the streams */                analyze_streams (data);            }        }    }    break;    }    /* We want to keep receiving messages */    return TRUE;}
开发者ID:kissdarkwind,项目名称:samples,代码行数:34,


示例21: create_window

static GstBusSyncReplycreate_window (GstBus * bus, GstMessage * message, gpointer data){  GstGLClutterActor **actor = (GstGLClutterActor **) data;  static gint count = 0;  static GMutex *mutex = NULL;  // ignore anything but 'prepare-xwindow-id' element messages  if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)    return GST_BUS_PASS;  if (!gst_structure_has_name (message->structure, "prepare-xwindow-id"))    return GST_BUS_PASS;  if (!mutex)    mutex = g_mutex_new ();  g_mutex_lock (mutex);  if (count < N_ACTORS) {    g_message ("adding actor %d", count);    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),        actor[count]->win);    clutter_threads_add_idle ((GSourceFunc) create_actor, actor[count]);    count++;  }  g_mutex_unlock (mutex);  gst_message_unref (message);  return GST_BUS_DROP;}
开发者ID:zsx,项目名称:ossbuild,代码行数:31,


示例22: GST_MESSAGE_SRC

void GStreamerGWorld::setWindowOverlay(GstMessage* message){    GstObject* sink = GST_MESSAGE_SRC(message);#ifndef GST_API_VERSION_1    if (!GST_IS_X_OVERLAY(sink))#else    if (!GST_IS_VIDEO_OVERLAY(sink))#endif        return;    if (g_object_class_find_property(G_OBJECT_GET_CLASS(sink), "force-aspect-ratio"))        g_object_set(sink, "force-aspect-ratio", TRUE, NULL);    if (m_videoWindow) {        m_videoWindow->prepareForOverlay(message);#ifndef GST_API_VERSION_1// gst_x_overlay_set_window_handle was introduced in -plugins-base// 0.10.31, just like the macro for checking the version.#ifdef GST_CHECK_PLUGINS_BASE_VERSION        gst_x_overlay_set_window_handle(GST_X_OVERLAY(sink), m_videoWindow->videoWindowId());#else        gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(sink), m_videoWindow->videoWindowId());#endif#else        gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink), m_videoWindow->videoWindowId());#endif    }}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:30,


示例23: gst_bus_cb

static gbooleangst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx){	if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT &&		gst_structure_has_name(msg->structure, "level")) {		GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));		gchar *name = gst_element_get_name(src);		if (!strcmp(name, "level")) {			gdouble percent;			gdouble threshold;			GstElement *valve;			percent = gst_msg_db_to_percent(msg, "rms");			gtk_progress_bar_set_fraction(ctx->level, percent * 5);			percent = gst_msg_db_to_percent(msg, "decay");			threshold = gtk_range_get_value(ctx->threshold) / 100.0;			valve = gst_bin_get_by_name(GST_BIN(GST_ELEMENT_PARENT(src)), "valve");			g_object_set(valve, "drop", (percent < threshold), NULL);			g_object_set(ctx->level,					"text", (percent < threshold) ? _("DROP") : " ", NULL);		}		g_free(name);	}	return TRUE;}
开发者ID:Yalir,项目名称:Synthese4A,代码行数:30,


示例24: handle_message

static void handle_message (CustomData *data, GstMessage *msg) {  GError *err;  gchar *debug_info;  switch (GST_MESSAGE_TYPE (msg)) {    case GST_MESSAGE_ERROR:      gst_message_parse_error (msg, &err, &debug_info);      g_printerr ("Error received from element %s: %s/n", GST_OBJECT_NAME (msg->src), err->message);      g_printerr ("Debugging information: %s/n", debug_info ? debug_info : "none");      g_clear_error (&err);      g_free (debug_info);      data->terminate = TRUE;      break;    case GST_MESSAGE_EOS:      g_print ("End-Of-Stream reached./n");      data->terminate = TRUE;      break;    case GST_MESSAGE_STATE_CHANGED:{      GstState old_state, new_state, pending_state;      gst_message_parse_state_changed (msg, &old_state, &new_state, &pending_state);      g_print ("%s state changed from %s to %s:/n", GST_OBJECT_NAME (GST_MESSAGE_SRC (msg)),           gst_element_state_get_name (old_state), gst_element_state_get_name (new_state));      } break;    default:      /* We should not reach here */      g_printerr ("Unexpected message received./n");      break;  }  gst_message_unref (msg);}
开发者ID:rubenrua,项目名称:GstreamerCodeSnippets,代码行数:30,


示例25: bus_handler

static gbooleanbus_handler (GstBus * bus, GstMessage * message, gpointer data){  GMainLoop *loop = (GMainLoop *) data;  switch (message->type) {    case GST_MESSAGE_EOS:{      GST_LOG ("EOS event received");      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_ERROR:{      GError *gerror;      gchar *debug;      gst_message_parse_error (message, &gerror, &debug);      g_error ("Error from %s: %s (%s)/n",          GST_ELEMENT_NAME (GST_MESSAGE_SRC (message)), gerror->message,          GST_STR_NULL (debug));      g_error_free (gerror);      g_free (debug);      g_main_loop_quit (loop);      break;    }    case GST_MESSAGE_WARNING:{      g_main_loop_quit (loop);      break;    }    default:      break;  }  return TRUE;}
开发者ID:GrokImageCompression,项目名称:gst-plugins-good,代码行数:33,


示例26: BufferingMessageReceived

void GstEnginePipeline::BufferingMessageReceived(GstMessage* msg) {  // Only handle buffering messages from the queue2 element in audiobin - not  // the one that's created automatically by uridecodebin.  if (GST_ELEMENT(GST_MESSAGE_SRC(msg)) != queue_) {    return;  }  int percent = 0;  gst_message_parse_buffering(msg, &percent);  const GstState current_state = state();  if (percent == 0 && current_state == GST_STATE_PLAYING && !buffering_) {    buffering_ = true;    emit BufferingStarted();    SetState(GST_STATE_PAUSED);  } else if (percent == 100 && buffering_) {    buffering_ = false;    emit BufferingFinished();    SetState(GST_STATE_PLAYING);  } else if (buffering_) {    emit BufferingProgress(percent);  }}
开发者ID:Gu1,项目名称:Clementine,代码行数:26,


示例27: bus_message_cb

static voidbus_message_cb (GstBus     *bus,                GstMessage *message,                gpointer    user_data){	GthMediaViewerPage *self = user_data;	switch (GST_MESSAGE_TYPE (message)) {	case GST_MESSAGE_STATE_CHANGED: {		GstState old_state;		GstState new_state;		GstState pending_state;		old_state = new_state = GST_STATE_NULL;		gst_message_parse_state_changed (message, &old_state, &new_state, &pending_state);		self->priv->paused = (new_state == GST_STATE_PAUSED);		if (old_state == new_state)			break;		if (GST_MESSAGE_SRC (message) != GST_OBJECT (self->priv->playbin))			break;		update_current_position_bar (self, TRUE);		if ((old_state == GST_STATE_READY) && (new_state == GST_STATE_PAUSED)) {			update_stream_info (self);			gth_viewer_page_update_sensitivity (GTH_VIEWER_PAGE (self));		}		if ((old_state == GST_STATE_READY) || (new_state == GST_STATE_PAUSED))			update_volume_from_playbin (self);		if ((old_state == GST_STATE_PLAYING) || (new_state == GST_STATE_PLAYING))			update_play_button (self, new_state);		break;	}	case GST_MESSAGE_DURATION: {		GstFormat format;		format = GST_FORMAT_TIME;		gst_message_parse_duration (message, &format, &self->priv->duration);		update_current_position_bar (self, TRUE);		break;	}	case GST_MESSAGE_EOS:		reset_player_state (self);		break;	case GST_MESSAGE_BUFFERING: {		int percent = 0;		gst_message_parse_buffering (message, &percent);		g_print ("Buffering (%%%u percent done)", percent);		break;	}	default:		break;	}}
开发者ID:Peliadia,项目名称:gthumb,代码行数:60,


示例28: handle_message

static voidhandle_message (GstBus * bus, GstMessage * message, gpointer data){  switch (message->type) {    case GST_MESSAGE_EOS:      g_message ("got EOS");      g_main_loop_quit (loop);      break;    case GST_MESSAGE_WARNING:    case GST_MESSAGE_ERROR:    {      GError *gerror;      gchar *debug;      if (message->type == GST_MESSAGE_ERROR)        gst_message_parse_error (message, &gerror, &debug);      else        gst_message_parse_warning (message, &gerror, &debug);      gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);      g_error_free (gerror);      g_free (debug);      if (message->type == GST_MESSAGE_ERROR)        g_main_loop_quit (loop);      break;    }    default:      break;  }}
开发者ID:lubing521,项目名称:gst-embedded-builder,代码行数:30,


示例29: handle_missing_plugin_message

static voidhandle_missing_plugin_message (RBPlayerGst *player, GstMessage *message){	char **details;	char **descriptions;	char *detail;	char *description;	int count;	rb_debug ("got missing-plugin message from %s: %s",		  GST_OBJECT_NAME (GST_MESSAGE_SRC (message)),		  gst_missing_plugin_message_get_installer_detail (message));	/* probably need to wait to collect any subsequent missing-plugin	 * messages, but I think we'd need to wait for state changes to do	 * that.  for now, we can only handle a single message.	 */	count = 1;	details = g_new0 (char *, count + 1);	descriptions = g_new0 (char *, count + 1);	detail = gst_missing_plugin_message_get_installer_detail (message);	description = gst_missing_plugin_message_get_description (message);	details[0] = g_strdup (detail);	descriptions[0] = g_strdup (description);	g_signal_emit (player, signals[MISSING_PLUGINS], 0, player->priv->stream_data, details, descriptions);	g_strfreev (details);	g_strfreev (descriptions);}
开发者ID:wangd,项目名称:rhythmbox,代码行数:31,



注:本文中的GST_MESSAGE_SRC函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GST_MINI_OBJECT_CAST函数代码示例
C++ GST_MAKE_FOURCC函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。