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

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

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

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

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

示例1: on_bus_element_cb

static voidon_bus_element_cb (GstBus *bus, GstMessage *message,    GbpPlayer *player){  const GstStructure *structure;  const gchar *structure_name;  GstElement *sink;  structure = gst_message_get_structure (message);  if (structure == NULL)    return;  structure_name = gst_structure_get_name (structure);#ifdef XP_MACOSX  if (!strcmp (structure_name, "have-ns-view") ||      !strcmp (structure_name, "have-ca-layer")) {    if (player->priv->xid != 0) {      gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_ELEMENT (message->src)),          (gulong) player->priv->xid);    }    return;  }#endif  if (!strcmp (structure_name, "prepare-xwindow-id")) {    sink = GST_ELEMENT (message->src);    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (sink), player->priv->xid);  }}
开发者ID:alessandrod,项目名称:gst-browser-plugin,代码行数:29,


示例2: preview_draw_cb

G_MODULE_EXPORT gbooleanpreview_draw_cb(    GtkWidget *widget,    cairo_t *cr,    signal_user_data_t *ud){#if defined(_ENABLE_GST)#if GST_CHECK_VERSION(1, 0, 0)    if (ud->preview->live_enabled && ud->preview->state == PREVIEW_STATE_LIVE)    {        if (GST_STATE(ud->preview->play) >= GST_STATE_PAUSED)        {            GstElement *vsink;            GstVideoOverlay *vover;            g_object_get(ud->preview->play, "video-sink", &vsink, NULL);            if (GST_IS_BIN(vsink))                vover = GST_VIDEO_OVERLAY(gst_bin_get_by_interface(                                    GST_BIN(vsink), GST_TYPE_VIDEO_OVERLAY));            else                vover = GST_VIDEO_OVERLAY(vsink);            gst_video_overlay_expose(vover);            // For some reason, the exposed region doesn't always get            // cleaned up here. But a delayed gst_x_overlay_expose()            // takes care of it.            g_idle_add((GSourceFunc)delayed_expose_cb, ud);        }        return FALSE;    }#else    if (ud->preview->live_enabled && ud->preview->state == PREVIEW_STATE_LIVE)    {        if (GST_STATE(ud->preview->play) >= GST_STATE_PAUSED)        {            GstElement *vsink;            GstXOverlay *xover;            g_object_get(ud->preview->play, "video-sink", &vsink, NULL);            if (GST_IS_BIN(vsink))                xover = GST_X_OVERLAY(gst_bin_get_by_interface(                                        GST_BIN(vsink), GST_TYPE_X_OVERLAY));            else                xover = GST_X_OVERLAY(vsink);            gst_x_overlay_expose(xover);            // For some reason, the exposed region doesn't always get            // cleaned up here. But a delayed gst_x_overlay_expose()            // takes care of it.            g_idle_add((GSourceFunc)delayed_expose_cb, ud);        }        return FALSE;    }#endif#endif    if (ud->preview->pix != NULL)    {        _draw_pixbuf(cr, ud->preview->pix);    }    return FALSE;}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:60,


示例3: empathy_video_widget_draw

static gbooleanempathy_video_widget_draw (GtkWidget *widget,    cairo_t *cr){  EmpathyVideoWidget *self = EMPATHY_VIDEO_WIDGET (widget);  EmpathyVideoWidgetPriv *priv = GET_PRIV (self);  GtkAllocation allocation;  if (priv->overlay == NULL)    {      gtk_widget_get_allocation (widget, &allocation);      gtk_render_frame (gtk_widget_get_style_context (widget), cr,          0, 0,          gtk_widget_get_allocated_width (widget),          gtk_widget_get_allocated_height (widget));      return TRUE;    }  gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (priv->overlay),    GDK_WINDOW_XID (gtk_widget_get_window (widget)));  gst_x_overlay_expose (GST_X_OVERLAY (priv->overlay));  return TRUE;}
开发者ID:sharat-dev,项目名称:empathy_sharat,代码行数:26,


示例4: 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,


示例5: 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,


示例6: gst_bin_get_by_interface

voidBasePlatformInterface::PrepareVideoWindow(GstMessage *aMessage){  GstElement *element = NULL;  GstXOverlay *xoverlay = NULL;  if (GST_IS_BIN (mVideoSink)) {    /* Get the actual implementing object from the bin */    element = gst_bin_get_by_interface(GST_BIN (mVideoSink),            GST_TYPE_X_OVERLAY);  }  else {    element = mVideoSink;  }  if (GST_IS_X_OVERLAY (element)) {    xoverlay = GST_X_OVERLAY (element);    LOG(("xoverlay interface found, setting video window"));  }  else {    LOG(("No xoverlay interface found, cannot set video window"));    return;  }  SetXOverlayWindowID(xoverlay);  ResizeToWindow();}
开发者ID:Brijen,项目名称:nightingale-hacking,代码行数:28,


示例7: set_gst_sdl_video_overlay

Windowset_gst_sdl_video_overlay (GstElement *pipeline,                           int x,                           int y,                           int width,                           int height){  GstElement *videosink;  SDL_SysWMinfo sdl_info;  Window play_win;  sdl_info = get_sdl_wm_info ();  if (!sdl_info.version.major)    return 0;  g_object_get (pipeline, "video-sink", &videosink, NULL);  if (videosink && GST_IS_X_OVERLAY (videosink)) {    sdl_info.info.x11.lock_func ();    play_win = create_x11_subwindow (sdl_info.info.x11.display,                                     sdl_info.info.x11.window,                                     x, y, width, height);    sdl_info.info.x11.unlock_func ();    gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (videosink), play_win);  } else    play_win = 0;  g_object_unref (videosink);  return play_win;}
开发者ID:barbieri,项目名称:barbieri-playground,代码行数:33,


示例8: 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,


示例9: 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,


示例10: gst_structure_has_name

bool QGstreamerGLTextureRenderer::processSyncMessage(const QGstreamerMessage &message){    GstMessage* gm = message.rawMessage();    if ((GST_MESSAGE_TYPE(gm) == GST_MESSAGE_ELEMENT) &&            gst_structure_has_name(gm->structure, "prepare-xwindow-id") &&            m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) {#ifdef GL_TEXTURE_SINK_DEBUG    qDebug() << Q_FUNC_INFO;#endif        GstXOverlay *overlay = GST_X_OVERLAY(m_videoSink);        gst_x_overlay_set_xwindow_id(overlay, m_winId);        if (!m_displayRect.isEmpty()) {            gst_x_overlay_set_render_rectangle(overlay,                                               m_displayRect.x(),                                               m_displayRect.y(),                                               m_displayRect.width(),                                               m_displayRect.height());        }        GstPad *pad = gst_element_get_static_pad(m_videoSink,"sink");        m_bufferProbeId = gst_pad_add_buffer_probe(pad, G_CALLBACK(padBufferProbe), this);        return true;    }    return false;}
开发者ID:Elleo,项目名称:qtmultimedia,代码行数:30,


示例11: switch

void Pipeline::setResolution(Resolution value){    int width, height;    switch (value) {    case Low:        // QVGA        width = LOW_RES_WIDTH;        height = LOW_RES_HEIGHT;        break;    case Medium:        // VGA        width = MID_RES_WIDTH;        height = MID_RES_HEIGHT;        break;    case High:        // WVGA        width = HIGH_RES_WIDTH;        height = HIGH_RES_HEIGHT;        break;    default:        qCritical() << "Unsupported resolution value " << value;        return;    }    g_signal_emit_by_name(camerabin, "set-video-resolution-fps",                          width, height, VIDEO_FRN, VIDEO_FRD, NULL);    // set new rendering position to the viewfinder    gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(viewfinder),                                       32,                                       30,                                       560,                                       420);}
开发者ID:foolab,项目名称:aura,代码行数:35,


示例12: gst_v4l2_xoverlay_prepare_xwindow_id

/** * gst_v4l2_xoverlay_prepare_xwindow_id: * @v4l2object: the v4l2object * @required: %TRUE if display is required (ie. TRUE for v4l2sink, but *   FALSE for any other element with optional overlay capabilities) * * Helper function to create a windo if none is set from the application. */voidgst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object,    gboolean required){  if (!GST_V4L2_IS_OVERLAY (v4l2object))    return;  gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (v4l2object->element));  if (required && !v4l2object->xwindow_id) {    GstV4l2Xv *v4l2xv;    Window win;    int width, height;    long event_mask;    if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))      gst_v4l2_xoverlay_open (v4l2object);    v4l2xv = v4l2object->xv;    /* if xoverlay is not supported, just bail */    if (!v4l2xv)      return;    /* xoverlay is supported, but we don't have a window.. so create one */    GST_DEBUG_OBJECT (v4l2object->element, "creating window");    g_mutex_lock (v4l2xv->mutex);    width = XDisplayWidth (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));    height = XDisplayHeight (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));    GST_DEBUG_OBJECT (v4l2object->element, "dpy=%p", v4l2xv->dpy);    win = XCreateSimpleWindow (v4l2xv->dpy,        DefaultRootWindow (v4l2xv->dpy),        0, 0, width, height, 0, 0,        XBlackPixel (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy)));    GST_DEBUG_OBJECT (v4l2object->element, "win=%lu", win);    event_mask = ExposureMask | StructureNotifyMask;    if (GST_IS_NAVIGATION (v4l2object->element)) {      event_mask |= PointerMotionMask |          KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;    }    XSelectInput (v4l2xv->dpy, win, event_mask);    v4l2xv->event_id = g_timeout_add (45, event_refresh, v4l2object);    XMapRaised (v4l2xv->dpy, win);    XSync (v4l2xv->dpy, FALSE);    g_mutex_unlock (v4l2xv->mutex);    GST_DEBUG_OBJECT (v4l2object->element, "got window");    gst_v4l2_xoverlay_set_window_handle (v4l2object, win);  }}
开发者ID:matsu,项目名称:gst-plugins-good,代码行数:67,


示例13: gst_x_overlay_set_render_rectangle

void QGstreamerVideoWindow::setDisplayRect(const QRect &rect){    m_displayRect = rect;    if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) {#if GST_VERSION_MICRO >= 29        if (m_displayRect.isEmpty())            gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink), -1, -1, -1, -1);        else            gst_x_overlay_set_render_rectangle(GST_X_OVERLAY(m_videoSink),                                               m_displayRect.x(),                                               m_displayRect.y(),                                               m_displayRect.width(),                                               m_displayRect.height());        repaint();#endif    }}
开发者ID:xjohncz,项目名称:qt5,代码行数:18,


示例14: tsmf_window_create

int tsmf_window_create(TSMFGstreamerDecoder* decoder){	struct X11Handle* hdl;	if (decoder->media_type != TSMF_MAJOR_TYPE_VIDEO)	{		decoder->ready = TRUE;		return -3;	}	else	{#if GST_VERSION_MAJOR > 0		GstVideoOverlay *overlay = GST_VIDEO_OVERLAY(decoder->outsink);#else		GstXOverlay *overlay = GST_X_OVERLAY(decoder->outsink);#endif		if (!decoder)			return -1;		if (!decoder->platform)			return -1;		hdl = (struct X11Handle*) decoder->platform;		if (!hdl->subwin)		{			int event, error;			hdl->subwin = XCreateSimpleWindow(hdl->disp, *(int *)hdl->xfwin, 0, 0, 1, 1, 0, 0, 0);			if (!hdl->subwin)			{				WLog_ERR(TAG, "Could not create subwindow!");			}			XMapWindow(hdl->disp, hdl->subwin);			XSync(hdl->disp, FALSE);#if GST_VERSION_MAJOR > 0			gst_video_overlay_set_window_handle(overlay, hdl->subwin);#else			gst_x_overlay_set_window_handle(overlay, hdl->subwin);#endif			decoder->ready = TRUE;#if defined(WITH_XEXT)			hdl->has_shape = XShapeQueryExtension(hdl->disp, &event, &error);#endif		}#if GST_VERSION_MAJOR > 0		gst_video_overlay_handle_events(overlay, TRUE);#else		gst_x_overlay_handle_events(overlay, TRUE);#endif		return 0;	}}
开发者ID:Distrotech,项目名称:FreeRDP,代码行数:56,


示例15: gst_vdp_sink_set_property

static voidgst_vdp_sink_set_property (GObject * object, guint prop_id,    const GValue * value, GParamSpec * pspec){  VdpSink *vdp_sink;  g_return_if_fail (GST_IS_VDP_SINK (object));  vdp_sink = GST_VDP_SINK (object);  switch (prop_id) {    case PROP_DISPLAY:      vdp_sink->display_name = g_strdup (g_value_get_string (value));      break;    case PROP_SYNCHRONOUS:      vdp_sink->synchronous = g_value_get_boolean (value);      if (vdp_sink->device) {        GST_DEBUG_OBJECT (vdp_sink, "XSynchronize called with %s",            vdp_sink->synchronous ? "TRUE" : "FALSE");        g_mutex_lock (vdp_sink->x_lock);        XSynchronize (vdp_sink->device->display, vdp_sink->synchronous);        g_mutex_unlock (vdp_sink->x_lock);      }      break;    case PROP_PIXEL_ASPECT_RATIO:    {      GValue *tmp;      tmp = g_new0 (GValue, 1);      g_value_init (tmp, GST_TYPE_FRACTION);      if (!g_value_transform (value, tmp)) {        GST_WARNING_OBJECT (vdp_sink,            "Could not transform string to aspect ratio");        g_free (tmp);      } else {        GST_DEBUG_OBJECT (vdp_sink, "set PAR to %d/%d",            gst_value_get_fraction_numerator (tmp),            gst_value_get_fraction_denominator (tmp));        g_free (vdp_sink->par);        vdp_sink->par = tmp;      }    }      break;    case PROP_HANDLE_EVENTS:      gst_vdp_sink_set_event_handling (GST_X_OVERLAY (vdp_sink),          g_value_get_boolean (value));      break;    case PROP_HANDLE_EXPOSE:      vdp_sink->handle_expose = g_value_get_boolean (value);      break;    default:      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);      break;  }}
开发者ID:spunktsch,项目名称:svtplayer,代码行数:56,


示例16: empathy_video_widget_expose_event

static gbooleanempathy_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event){  EmpathyVideoWidget *self = EMPATHY_VIDEO_WIDGET (widget);  EmpathyVideoWidgetPriv *priv = GET_PRIV (self);  if (event != NULL && event->count > 0)    return TRUE;  if (priv->overlay == NULL)    return TRUE;  gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (priv->overlay),    GDK_WINDOW_XID (widget->window));  gst_x_overlay_expose (GST_X_OVERLAY (priv->overlay));  return TRUE;}
开发者ID:Elleo,项目名称:empathy,代码行数:19,


示例17: displayed

void Video_RX::run(){        emit displayed(video_sink,2);        gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);        gst_x_overlay_expose(GST_X_OVERLAY(video_sink));        new_video_rx_stream=true;}
开发者ID:Jalilpiran,项目名称:CogWave,代码行数:11,


示例18: gst_x_overlay_set_xwindow_id

void X11Renderer::setOverlay(){    if (m_videoSink && GST_IS_X_OVERLAY(m_videoSink)) {        WId windowId = m_renderWidget->winId();        // Even if we have created a winId at this point, other X applications        // need to be aware of it.        QApplication::syncX();        gst_x_overlay_set_xwindow_id ( GST_X_OVERLAY(m_videoSink) ,  windowId );    }    windowExposed();    m_overlaySet = true;}
开发者ID:FilipBE,项目名称:qtextended,代码行数:12,


示例19: qDebug

 void VideoWidget::WindowExposed() {     if (video_overlay_ && GST_IS_X_OVERLAY(video_overlay_))     {         // Expose the overlay (some sort of update)         qDebug() << name_ << " >> WindowExposed() called";         #ifdef Q_WS_X11             QApplication::syncX();         #endif         gst_x_overlay_expose(GST_X_OVERLAY(video_overlay_));     } }
开发者ID:caocao,项目名称:naali,代码行数:12,


示例20: main

int main(int argc, char *argv[]){#if !GLIB_CHECK_VERSION (2, 31, 0)  if (!g_thread_supported ())    g_thread_init (NULL);#endif  gst_init (&argc, &argv);  QApplication app(argc, argv);  app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));  /* prepare the pipeline */  GstElement *pipeline = gst_pipeline_new ("xvoverlay");  GstElement *src = gst_element_factory_make ("videotestsrc", NULL);  GstElement *sink = find_video_sink ();  if (sink == NULL)    g_error ("Couldn't find a working video sink.");  gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);  gst_element_link (src, sink);    /* prepare the ui */  QWidget window;  window.resize(320, 240);  window.setWindowTitle("GstXOverlay Qt demo");  window.show();    WId xwinid = window.winId();  gst_x_overlay_set_window_handle (GST_X_OVERLAY (sink), xwinid);  /* run the pipeline */  GstStateChangeReturn sret = gst_element_set_state (pipeline,      GST_STATE_PLAYING);  if (sret == GST_STATE_CHANGE_FAILURE) {    gst_element_set_state (pipeline, GST_STATE_NULL);    gst_object_unref (pipeline);    /* Exit application */    QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit()));  }  int ret = app.exec();    window.hide();  gst_element_set_state (pipeline, GST_STATE_NULL);  gst_object_unref (pipeline);  return ret;}
开发者ID:adenexter,项目名称:gst-plugins-base,代码行数:52,


示例21: gst_v4l2_xoverlay_prepare_xwindow_id

/** * gst_v4l2_xoverlay_prepare_xwindow_id: * @v4l2object: the v4l2object * @required: %TRUE if display is required (ie. TRUE for v4l2sink, but *   FALSE for any other element with optional overlay capabilities) * * Helper function to create a windo if none is set from the application. */voidgst_v4l2_xoverlay_prepare_xwindow_id (GstV4l2Object * v4l2object,    gboolean required){  if (!GST_V4L2_IS_OVERLAY (v4l2object))    return;  gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (v4l2object->element));  if (required && !v4l2object->xwindow_id) {    GstV4l2Xv *v4l2xv;    Window win;    int width, height;    if (!v4l2object->xv && GST_V4L2_IS_OPEN (v4l2object))      gst_v4l2_xoverlay_open (v4l2object);    v4l2xv = v4l2object->xv;    /* if xoverlay is not supported, just bail */    if (!v4l2xv)      return;    /* xoverlay is supported, but we don't have a window.. so create one */    GST_DEBUG_OBJECT (v4l2object->element, "creating window");    g_mutex_lock (v4l2xv->mutex);    width = XDisplayWidth (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));    height = XDisplayHeight (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy));    GST_DEBUG_OBJECT (v4l2object->element, "dpy=%p", v4l2xv->dpy);    win = XCreateSimpleWindow (v4l2xv->dpy,        DefaultRootWindow (v4l2xv->dpy),        0, 0, width, height, 0, 0,        XBlackPixel (v4l2xv->dpy, DefaultScreen (v4l2xv->dpy)));    GST_DEBUG_OBJECT (v4l2object->element, "win=%lu", win);    XMapRaised (v4l2xv->dpy, win);    XSync (v4l2xv->dpy, FALSE);    v4l2xv->internal_window = TRUE;    g_mutex_unlock (v4l2xv->mutex);    GST_DEBUG_OBJECT (v4l2object->element, "got window");    gst_v4l2_xoverlay_set_window_handle (v4l2object, win);  }}
开发者ID:z7z8th,项目名称:gstreamer-ducati,代码行数:59,


示例22: empathy_video_widget_expose_event

static gbooleanempathy_video_widget_expose_event (GtkWidget *widget, GdkEventExpose *event){  EmpathyVideoWidget *self = EMPATHY_VIDEO_WIDGET (widget);  EmpathyVideoWidgetPriv *priv = GET_PRIV (self);  if (event != NULL && event->count > 0)    return TRUE;  if (priv->overlay == NULL)    {      gdk_window_clear_area (gtk_widget_get_window (widget), 0, 0,        widget->allocation.width, widget->allocation.height);      return TRUE;    }  gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (priv->overlay),    GDK_WINDOW_XID (gtk_widget_get_window (widget)));  gst_x_overlay_expose (GST_X_OVERLAY (priv->overlay));  return TRUE;}
开发者ID:james-w,项目名称:empathy,代码行数:23,


示例23: bp_video_find_xoverlay

static gbooleanbp_video_find_xoverlay (BansheePlayer *player){    GstElement *video_sink = NULL;    GstElement *xoverlay;    GstXOverlay *previous_xoverlay;    gboolean    found_xoverlay;    g_object_get (player->playbin, "video-sink", &video_sink, NULL);    g_mutex_lock (player->video_mutex);    previous_xoverlay = player->xoverlay;    if (video_sink == NULL) {        player->xoverlay = NULL;        if (previous_xoverlay != NULL) {            gst_object_unref (previous_xoverlay);        }        g_mutex_unlock (player->video_mutex);        return FALSE;    }       xoverlay = GST_IS_BIN (video_sink)        ? gst_bin_get_by_interface (GST_BIN (video_sink), GST_TYPE_X_OVERLAY)        : video_sink;        player->xoverlay = GST_IS_X_OVERLAY (xoverlay) ? GST_X_OVERLAY (xoverlay) : NULL;        if (previous_xoverlay != NULL) {        gst_object_unref (previous_xoverlay);    }        #if !defined(GDK_WINDOWING_WIN32) // We can't rely on aspect ratio from dshowvideosink    if (player->xoverlay != NULL && g_object_class_find_property (        G_OBJECT_GET_CLASS (player->xoverlay), "force-aspect-ratio")) {        g_object_set (G_OBJECT (player->xoverlay), "force-aspect-ratio", TRUE, NULL);    }#endif        if (player->xoverlay != NULL && g_object_class_find_property (        G_OBJECT_GET_CLASS (player->xoverlay), "handle-events")) {        g_object_set (G_OBJECT (player->xoverlay), "handle-events", FALSE, NULL);    }    gst_object_unref (video_sink);    found_xoverlay = (player->xoverlay != NULL) ? TRUE : FALSE;    g_mutex_unlock (player->video_mutex);    return found_xoverlay;}
开发者ID:3dfxmadscientist,项目名称:gnome-apps,代码行数:50,


示例24: delayed_expose_cb

G_MODULE_EXPORT gbooleandelayed_expose_cb(signal_user_data_t *ud){    GstElement *vsink;    GstXOverlay *xover;    if (!ud->preview->live_enabled)        return FALSE;    g_object_get(ud->preview->play, "video-sink", &vsink, NULL);    if (vsink == NULL)        return FALSE;    if (GST_IS_BIN(vsink))        xover = GST_X_OVERLAY(gst_bin_get_by_interface(                                GST_BIN(vsink), GST_TYPE_X_OVERLAY));    else        xover = GST_X_OVERLAY(vsink);    gst_x_overlay_expose(xover);    // This function is initiated by g_idle_add.  Must return false    // so that it is not called again    return FALSE;}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:23,


示例25: switch

gboolean VideoReceiver::busCall(GstBus     *,								GstMessage *message,								gpointer    data){  VideoReceiver *vr = static_cast<VideoReceiver *>(data);  GError *error = NULL;  gchar *debug = NULL;  switch (GST_MESSAGE_TYPE(message)) {  case GST_MESSAGE_ERROR:	gst_message_parse_error(message, &error, &debug);	qWarning("Error: %s", error->message);	g_error_free(error);	g_free(debug);    	break;  case GST_MESSAGE_EOS:	// end-of-stream	// g_main_loop_quit(loop);	qWarning("%s: Warning: EOS", __FUNCTION__);	break;  case GST_MESSAGE_WARNING:	gst_message_parse_warning(message, &error, &debug);	if (error != NULL) {	  qWarning("Warning: %s", error->message);	  g_error_free(error);	}	if (debug != NULL) {	  qDebug("Debug: %s", debug);	  g_free(debug);	}	break;  case GST_MESSAGE_ELEMENT:		if (gst_structure_has_name(message->structure, "prepare-xwindow-id") && vr->xid != 0) {	  qDebug("%s - prepare-xwindow-id", __FUNCTION__);	  gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(GST_MESSAGE_SRC(message)), vr->xid);	}    	break;  default:	// Unhandled message 	//qWarning("Unhandled message type: %d", GST_MESSAGE_TYPE(message));	break;  }    return true;}
开发者ID:snowcap-electronics,项目名称:snowcap-controller,代码行数:50,


示例26: gst_native_surface_finalize

static void gst_native_surface_finalize (JNIEnv *env, jobject thiz) {  CustomData *data = GET_CUSTOM_DATA (env, thiz, custom_data_field_id);  if (!data) return;  GST_DEBUG ("Releasing Native Window %p", data->native_window);  if (data->pipeline) {    gst_x_overlay_set_window_handle (GST_X_OVERLAY (data->pipeline), (guintptr)NULL);    gst_element_set_state (data->pipeline, GST_STATE_READY);  }  ANativeWindow_release (data->native_window);  data->native_window = NULL;  data->initialized = FALSE;}
开发者ID:0x8BADFOOD,项目名称:GstreamerCodeSnippets,代码行数:14,



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


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