|
g_videoWindow->drawear = gtk_drawing_area_new();
g_return_if_fail (g_videoWindow->drawear != NULL);
gtk_container_add(GTK_CONTAINER(g_videoWindow->window), g_videoWindow->drawear);
start_player(GTK_WIDGET(g_videoWindow->window),
g_videoWindow->drawear,
TRUE);
void start_player(GtkWidget *parentWindow,
GtkWidget *drawear,
gboolean play)
{
....................
g_player->videoWindow = parentWindow;
g_player->videoWindowDrawear = drawear;
........................
}
static gboolean my_bus_callback (GstBus * bus, GstMessage * message, gpointer data)
{
.....................
switch (GST_MESSAGE_TYPE (message)) {
...............................
case GST_MESSAGE_ELEMENT:{
..............................
gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (GST_MESSAGE_SRC (message)),
GDK_WINDOW_XWINDOW (player->videoWindowDrawear->window));
..................................
}
}
display_image_window(GTK_WIDGET(g_videoWindow->window), "./image/forward.png");
void display_image_window(GtkWidget *parentWindow, gchar *imageFile)
{
...................................
g_imageWindow->parntWindow = parentWindow;
g_imageWindow->imageWindow = gtk_dialog_new_with_buttons(NULL,
GTK_WINDOW(g_imageWindow->parntWindow),
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT|GTK_DIALOG_NO_SEPARATOR,
NULL);
.....................................
}
这是一些程序的片段,大家帮我分析一下,程序使用GTK和gstreamer构建一个视频播放的窗口,gstreamer总线收到消息调用my_bus_callback,根据消息的类型处理
将视频显示到窗口上(调用函数gst_x_overlay_set_xwindow_id实现)。
现在要在每次切换视频内容,上一曲,或下一曲时在窗口上显示一个图标(左右箭头)。实现的方法是生成一个对话框(调用函数gtk_dialog_new_with_buttons)
在PC上这样实现没有问题。但在IMX233上这样实现。。这个对话框始终显示不出来。被视频给盖住了。。 |
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|