GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Jul 25, 2014 7:59 pm

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Gtk and LibVLC Multimedia Player Example (C)
PostPosted: Sat Oct 03, 2009 5:55 am 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
GTK wrapper for LibVLC. This library allows you to use libvlc from C code in a GTK interface with GTK widget representing the player.

http://code.google.com/p/libvlc-gtk/
svn checkout http://libvlc-gtk.googlecode.com/svn/trunk/ libvlc-gtk-read-only

This is the example application supplyed by libvlc-gtk
Note: You need a current stable vlc.

Image

Code:
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8-*- */
#include "gtk-libvlc-media-player.h"

static void
on_window_destroy(GtkWindow *window, gpointer user_data)
{
   gtk_main_quit();
}

static void
on_scale_value_changed(GtkRange *range, gpointer  user_data)
{
   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("value-changed\n");
   
}

static void
on_button_play_clicked(GtkButton *button, gpointer user_data)

   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("play\n");
   gtk_libvlc_media_player_play(vlc, NULL);
}

static void
on_button_stop_clicked(GtkButton *button, gpointer user_data)

   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("stop\n");
   gtk_libvlc_media_player_stop(vlc);
}

static void
on_button_record_clicked(GtkButton *button, gpointer user_data)

   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("record\n");
   // gchar *options[] = {":vout-filter=transform", ":transform-type=90", NULL};
   gchar *options[] = {":sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst='./test.ts'}}", NULL};
   gtk_libvlc_media_player_play(vlc, options);
}

static void
on_button_next_clicked(GtkButton *button, gpointer user_data)

   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("play next\n");
   gtk_libvlc_media_player_play_next(vlc, NULL);
}

static void
on_button_value_changed (GtkScaleButton *button,
          gdouble value, gpointer user_data)
{
   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("value-changed : %f\n", value);
   gtk_libvlc_media_player_set_volume (vlc, value);
   gtk_libvlc_media_player_get_volume(vlc);
}

static void
on_button_fullscreen_clicked(GtkButton *button, gpointer user_data)

   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("fullscreen\n");
   gtk_libvlc_media_player_set_fullscreen(vlc, TRUE);
}

static void
on_button_destroy_clicked(GtkButton *button, gpointer user_data)
{
   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   g_print("destroy\n");
   gtk_widget_destroy(GTK_WIDGET(vlc));
}

static void
on_row_displayed_playlist (GtkTreeViewColumn *col,
            GtkCellRenderer *renderer, GtkTreeModel *model,
            GtkTreeIter *iter, gpointer user_data)
{
   GtkLibVLCMedia* media;
   gtk_tree_model_get(model, iter, GTK_LIBVLC_MODEL_MEDIA_COLUMN, &media, -1);
   g_object_set(renderer, "text", media->mrl, "visible", TRUE, NULL);
}

static void
on_row_activated (GtkTreeView *tree_view, GtkTreePath *path,
        GtkTreeViewColumn *column, gpointer user_data)
{
   GtkLibVLCMediaPlayer *vlc = (GtkLibVLCMediaPlayer*)user_data;
   gtk_libvlc_media_player_play_media_at_path(vlc, path, NULL);
}

int main (int argc, char ** argv)
{
   GtkWidget *window;
   GtkWidget *hbox;   
   
   gtk_init(&argc, &argv);
   
   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title(GTK_WINDOW(window), "GtkVLCMediaPlayer widget");
   gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
   gtk_window_set_default_size(GTK_WINDOW(window), 600, 400);
   
   g_signal_connect(G_OBJECT(window), "destroy",
          G_CALLBACK(on_window_destroy), NULL);
   
   hbox = gtk_hbox_new(TRUE, 2);
   
   GtkLibVLCInstance* instance;
   const gchar* vlc_args[] = {
      "-I dummy", /* Don't use any interface */
      "--ignore-config", /* Don't use VLC's config */
      "--extraintf=logger", //log anything
      "-vvv" //be much more verbose then normal for debugging purpose
   };
   instance = gtk_libvlc_instance_new(vlc_args);
   //instance = gtk_libvlc_instance_new(NULL);
   
   // Create players
   int i;
   for(i=0; i<1; i++){
      GtkWidget *vbox;
      GtkWidget *vlc;
      GtkWidget *hbox_button;
      GtkWidget *button;
      GtkWidget *treeview;
      GtkWidget *hpaned;
      GtkWidget *scale;

      GtkTreeViewColumn *column;
      GtkCellRenderer *renderer;
      
      hpaned = gtk_hpaned_new ();
      gtk_paned_set_position (GTK_PANED(hpaned), 400);

      vbox = gtk_vbox_new(FALSE, 0);
      gtk_paned_add1 (GTK_PANED(hpaned), vbox);
      
      // Media player
      vlc = gtk_libvlc_media_player_new(instance);
      gtk_libvlc_media_player_set_volume (GTK_LIBVLC_MEDIA_PLAYER(vlc), 0.7);
      gtk_box_pack_start (GTK_BOX(vbox), vlc, TRUE, TRUE, 2);      
      
      // HScale
      hbox_button = gtk_hbox_new(FALSE, 0);
      gtk_box_pack_start (GTK_BOX(vbox), hbox_button, FALSE, TRUE, 0);

      scale = gtk_hscale_new_with_range (0.0, 1.0, 0.1);
      gtk_scale_set_draw_value (GTK_SCALE(scale), TRUE);
      gtk_scale_set_value_pos (GTK_SCALE(scale), GTK_POS_RIGHT);
      g_signal_connect(G_OBJECT(scale), "value-changed",
             G_CALLBACK(on_scale_value_changed), vlc);
      gtk_box_pack_start (GTK_BOX(hbox_button), scale, TRUE, TRUE, 0);

      // Button bar
      hbox_button = gtk_hbox_new(FALSE, 0);
      gtk_box_pack_start (GTK_BOX(vbox), hbox_button, FALSE, FALSE, 0);            
      
      //  Play button
      button = gtk_button_new();
      gtk_button_set_image (GTK_BUTTON(button),
                  gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_BUTTON));
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_play_clicked), vlc);
      
      //  Stop button
      button = gtk_button_new();
      gtk_button_set_image (GTK_BUTTON(button),
                  gtk_image_new_from_stock(GTK_STOCK_MEDIA_STOP, GTK_ICON_SIZE_BUTTON));
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_stop_clicked), vlc);
      
      // Record button
      button = gtk_button_new();
      gtk_button_set_image (GTK_BUTTON(button),
                  gtk_image_new_from_stock(GTK_STOCK_MEDIA_RECORD, GTK_ICON_SIZE_BUTTON));
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_record_clicked), vlc);
      
      // Media next button
      button = gtk_button_new();
      gtk_button_set_image (GTK_BUTTON(button),
                  gtk_image_new_from_stock(GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_BUTTON));
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_next_clicked), vlc);
      
      // Volume button
      button = gtk_volume_button_new ();
      gdouble value = gtk_libvlc_media_player_get_volume(GTK_LIBVLC_MEDIA_PLAYER(vlc));
      gtk_scale_button_set_value (GTK_SCALE_BUTTON(button), value);

      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
             g_signal_connect(G_OBJECT(button), "value-changed",
             G_CALLBACK(on_button_value_changed), vlc);
      
      //  Fullscreen button
      button = gtk_button_new();
      gtk_button_set_image (GTK_BUTTON(button),
                  gtk_image_new_from_stock(GTK_STOCK_FULLSCREEN, GTK_ICON_SIZE_BUTTON));
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_fullscreen_clicked), vlc);
      
      // Destroy button
      button = gtk_button_new_with_label("destroy");
      gtk_box_pack_start (GTK_BOX(hbox_button), button, FALSE, FALSE, 0);
      g_signal_connect(G_OBJECT(button), "clicked",
             G_CALLBACK(on_button_destroy_clicked), vlc);

      // Playlist
      treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (GTK_LIBVLC_MEDIA_PLAYER(vlc)->media_list));
      column = gtk_tree_view_column_new();
      gtk_tree_view_column_set_title (column, "Playlist");
      renderer = gtk_cell_renderer_text_new ();
      gtk_tree_view_column_pack_start(column, renderer, FALSE);
      gtk_tree_view_column_set_cell_data_func(column, renderer, on_row_displayed_playlist,
                     NULL, NULL);
      gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
      g_signal_connect(G_OBJECT(treeview), "row-activated",
             G_CALLBACK(on_row_activated), vlc);      

      GtkWidget *scrolled_window = gtk_scrolled_window_new (NULL, NULL);
      //gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scrolled_window), treeview);
      gtk_container_add(GTK_CONTAINER(scrolled_window), treeview);
      gtk_paned_add2 (GTK_PANED(hpaned), scrolled_window);
      //gtk_box_pack_start (GTK_BOX(hbox_player), treeview, TRUE, TRUE, 0);      

      gtk_box_pack_start (GTK_BOX(hbox), hpaned, TRUE, TRUE, 0);


      // Populate the playlist
      GtkLibVLCMedia *media;
      
      media = gtk_libvlc_media_new("rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=678&flavour=sd");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("mms://vipmms9.yacast.net/aptv_live03");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("mms://vipmms9.yacast.net/bfm_bfmtv");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("http://streaming.radio.funradio.fr:80/fun-1-44-96");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("http://viphttp.yacast.net/V4/radiofrance/franceinfo_bd.m3u");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("./playlist.m3u");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      media = gtk_libvlc_media_new("v4l2://");
      gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
      g_object_unref(media);
      
   }
   
   gtk_container_add(GTK_CONTAINER(window), hbox);
   
   gtk_widget_show_all(window);
   
   gtk_main();

   g_object_unref(G_OBJECT(instance));
   
   return 0;
}




Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 23, 2009 10:41 am 
Offline
GTK+ Geek

Joined: Wed Mar 18, 2009 2:26 pm
Posts: 62
Thank you very much.. this really works very well.

do you know how to get ur webcam feed and how did you manage to get the links for the video feed.

_________________
Hello, העלו, Здравствулте!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 24, 2009 2:27 pm 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
Media List
----------------
media = gtk_libvlc_media_new("rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=678&flavour=sd");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("rtsp://mafreebox.freebox.fr/fbxtv_pub/stream?namespace=1&service=201&flavour=ld");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("mms://vipmms9.yacast.net/aptv_live03");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("mms://vipmms9.yacast.net/bfm_bfmtv");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("http://streaming.radio.funradio.fr:80/fun-1-44-96");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("http://viphttp.yacast.net/V4/radiofrance/franceinfo_bd.m3u");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);
media = gtk_libvlc_media_new("./playlist.m3u");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);

Web Camera
--------------------
media = gtk_libvlc_media_new("v4l2://");
gtk_libvlc_media_player_add_media(GTK_LIBVLC_MEDIA_PLAYER(vlc), media);
g_object_unref(media);


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 25, 2009 5:19 am 
Offline
GTK+ Geek

Joined: Wed Mar 18, 2009 2:26 pm
Posts: 62
Iam Sorry my question was not clear.
What I meant was from where do you find such links on the web.
I have tried to search for live web feeds link, but they only open a web page with the video already embedded.

Thanks for the tip on the web cam.

Any Idea how you select the audio device, Iam using Arch Linux and have two audio devices . 1- onboard and 2- a usb sound device.
Both of the devices show up if I run $aplay -l from the command line.
In my case it plays through the onboard sound card.
I want to set it such that for this GTK sample it uses the usb sound device.

_________________
Hello, העלו, Здравствулте!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 08, 2010 9:18 pm 
Offline
GTK+ Guru

Joined: Thu Jun 21, 2007 1:52 pm
Posts: 198
Location: Wilkes Barre Pa
nmanbamboo1980 wrote:
Iam Sorry my question was not clear.
What I meant was from where do you find such links on the web.
I have tried to search for live web feeds link, but they only open a web page with the video already embedded.

Thanks for the tip on the web cam.

Any Idea how you select the audio device, Iam using Arch Linux and have two audio devices . 1- onboard and 2- a usb sound device.
Both of the devices show up if I run $aplay -l from the command line.
In my case it plays through the onboard sound card.
I want to set it such that for this GTK sample it uses the usb sound device.


const gchar* vlc_args[] = {
"-I dummy", /* Don't use any interface */
"--ignore-config", /* Don't use VLC's config */
"--extraintf=logger", //log anything
"-vvv" //be much more verbose then normal for debugging purpose
};

Use the vlc command line options here.
http://wiki.videolan.org/VLC_command-line_help


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2010 10:01 am 
Offline

Joined: Sun Mar 14, 2010 6:59 pm
Posts: 3
Wow!! Nice example.. Can you rewrite it for non-block main window while playing??

Edit: Sorry, block only when play radio (playlists not tested).. Video streams works..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2010 9:43 am 
Offline
Familiar Face

Joined: Thu Feb 11, 2010 9:56 am
Posts: 28
I am quite new to GTK+ and C but has used LInux for a few years now. I have now managed to install libvlc-gtk and can see .c .h files in /usr/include and libraries in /usr/lib

But when i try to compile the code you posted in your thread i get the following errors:

[me@localhost vlctest]$ gcc -o myapp myapp.c `pkg-config --libs --cflags gtk+-2.0`
Package libvlc-gtk was not found in the pkg-config search path.
Perhaps you should add the directory containing `libvlc-gtk.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libvlc-gtk' found
myapp.c:2:37: error: gtk-libvlc-media-player.h: No such file or directory
myapp.c:3:21: error: gtk/gtk.h: No such file or directory
myapp.c:9: error: expected â)â before â*â token
myapp.c:15: error: expected â)â before â*â token
myapp.c:23: error: expected â)â before â*â token
myapp.c:31: error: expected â)â before â*â token
myapp.c:39: error: expected â)â before â*â token
myapp.c:49: error: expected â)â before â*â token
myapp.c:57: error: expected â)â before â*â token
myapp.c:67: error: expected â)â before â*â token
myapp.c:75: error: expected â)â before â*â token
myapp.c:83: error: expected â)â before â*â token
myapp.c:93: error: expected â)â before â*â token
myapp.c: In function âmainâ:
myapp.c:102: error: âGtkWidgetâ undeclared (first use in this function)
myapp.c:102: error: (Each undeclared identifier is reported only once
myapp.c:102: error: for each function it appears in.)
myapp.c:102: error: âwindowâ undeclared (first use in this function)
myapp.c:103: error: âhboxâ undeclared (first use in this function)
myapp.c:107: error: âGTK_WINDOW_TOPLEVELâ undeclared (first use in this function)
myapp.c:109: error: âGTK_WIN_POS_CENTERâ undeclared (first use in this function)
myapp.c:113: error: âon_window_destroyâ undeclared (first use in this function)
myapp.c:115: error: âTRUEâ undeclared (first use in this function)
myapp.c:117: error: âGtkLibVLCInstanceâ undeclared (first use in this function)
myapp.c:117: error: âinstanceâ undeclared (first use in this function)
myapp.c:118: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token
myapp.c:118: error: âvlc_argsâ undeclared (first use in this function)
myapp.c:118: error: expected expression before â]â token
myapp.c:130: error: âvboxâ undeclared (first use in this function)
myapp.c:131: error: âvlcâ undeclared (first use in this function)
myapp.c:132: error: âhbox_buttonâ undeclared (first use in this function)
myapp.c:133: error: âbuttonâ undeclared (first use in this function)
myapp.c:134: error: âtreeviewâ undeclared (first use in this function)
myapp.c:135: error: âhpanedâ undeclared (first use in this function)
myapp.c:136: error: âscaleâ undeclared (first use in this function)
myapp.c:138: error: âGtkTreeViewColumnâ undeclared (first use in this function)
myapp.c:138: error: âcolumnâ undeclared (first use in this function)
myapp.c:139: error: âGtkCellRendererâ undeclared (first use in this function)
myapp.c:139: error: ârendererâ undeclared (first use in this function)
myapp.c:144: error: âFALSEâ undeclared (first use in this function)
myapp.c:158: error: âGTK_POS_RIGHTâ undeclared (first use in this function)
myapp.c:160: error: âon_scale_value_changedâ undeclared (first use in this function)
myapp.c:170: error: âGTK_STOCK_MEDIA_PLAYâ undeclared (first use in this function)
myapp.c:170: error: âGTK_ICON_SIZE_BUTTONâ undeclared (first use in this function)
myapp.c:173: error: âon_button_play_clickedâ undeclared (first use in this function)
myapp.c:178: error: âGTK_STOCK_MEDIA_STOPâ undeclared (first use in this function)
myapp.c:181: error: âon_button_stop_clickedâ undeclared (first use in this function)
myapp.c:186: error: âGTK_STOCK_MEDIA_RECORDâ undeclared (first use in this function)
myapp.c:189: error: âon_button_record_clickedâ undeclared (first use in this function)
myapp.c:194: error: âGTK_STOCK_MEDIA_NEXTâ undeclared (first use in this function)
myapp.c:197: error: âon_button_next_clickedâ undeclared (first use in this function)
myapp.c:201: error: âgdoubleâ undeclared (first use in this function)
myapp.c:201: error: expected â;â before âvalueâ
myapp.c:202: error: âvalueâ undeclared (first use in this function)
myapp.c:206: error: âon_button_value_changedâ undeclared (first use in this function)
myapp.c:211: error: âGTK_STOCK_FULLSCREENâ undeclared (first use in this function)
myapp.c:214: error: âon_button_fullscreen_clickedâ undeclared (first use in this function)
myapp.c:220: error: âon_button_destroy_clickedâ undeclared (first use in this function)
myapp.c:223: error: invalid type argument of â->â (have âintâ)
myapp.c:228: error: âon_row_displayed_playlistâ undeclared (first use in this function)
myapp.c:232: error: âon_row_activatedâ undeclared (first use in this function)
myapp.c:234: error: âscrolled_windowâ undeclared (first use in this function)
myapp.c:244: error: âGtkLibVLCMediaâ undeclared (first use in this function)
myapp.c:244: error: âmediaâ undeclared (first use in this function)


So sorry for the length of above error text. Could you help me solve this issue?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 25, 2010 8:57 am 
Offline

Joined: Sun Mar 14, 2010 6:59 pm
Posts: 3
gcc cannot find gtk.h.. Try pkg-config gtk+-2.0 --libs, for ex.. If gtk in system then you see result string.. As for me I try this example and it`s works.. Check your system and libraries.. And check for pkg-config.. I use ArchLinux and there pkg-config doesn`t install with gtk+glib..

upd..
I use
[code=]svn checkout http://libvlc-gtk.googlecode.com/svn/trunk/ libvlc-gtk-read-only [/code] for tests..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 25, 2010 10:23 am 
Offline
Familiar Face

Joined: Thu Feb 11, 2010 9:56 am
Posts: 28
Hi all

I found that i was using wrong compiling command. I used below and it worked fine.

gcc -g -o myapp `pkg-config --cflags --libs gtk+-2.0 gthread-2.0 libvlc` -I/usr/include/libvlc-gtk/ -lvlc-gtk myapp.c


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 25, 2010 10:26 am 
Offline
Familiar Face

Joined: Thu Feb 11, 2010 9:56 am
Posts: 28
Hi all

The libvlc-gtk is very useful and helps get a gtk based video player steup very quickly.

Is there a way to achieve this with using libvlc-gtk and just use libvlc directly, if some one could provide a simple example i would really appriciate it.

Kind regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 05, 2010 3:02 am 
Offline
GTK+ Guru

Joined: Thu Nov 16, 2006 5:08 am
Posts: 259
Location: INDIA
[quote="caracal[/quote]

Hi
can libvlc-gtk is available windows machine?

any help it should be appreciable


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 16, 2010 10:15 am 
Offline
Familiar Face

Joined: Thu Jan 21, 2010 10:23 am
Posts: 8
Thanks very much caracal. It worked like a charm under Ubuntu 10.04 64 bits and using Eclipse Galileo.

Regards.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 04, 2011 12:18 pm 
Offline
Familiar Face

Joined: Sun Oct 25, 2009 8:00 am
Posts: 14
i am trying to use this program but compilation using the command
[code=]gcc -g -o myapp `pkg-config --cflags --libs gtk+-2.0 gthread-2.0 libvlc` -I/usr/include/libvlc-gtk/ -lvlc-gtk a.c
[/code]
gives lots of errors like
[code=]In file included from /usr/local/include/libvlc-gtk/gtk-libvlc-media-player.h:26,
from a.c:3:
/usr/local/include/libvlc-gtk/gtk-libvlc-include.h:29:2: error: #error "LIBVLC_VERSION_MAJOR must be defined."
/usr/local/include/libvlc-gtk/gtk-libvlc-include.h:34:2: error: #error "LIBVLC_VERSION_MINOR must be defined."
/usr/local/include/libvlc-gtk/gtk-libvlc-include.h:39:2: error: #error "LIBVLC_VERSION_REVISION must be defined."
a.c: In function ‘on_scale_value_changed’:
a.c:15: error: ‘GtkLibVLCMediaPlayer’ undeclared (first use in this function)
[/code]

Actually i installed "tuxTV" a libvlc-gtk based application. it is runnig properly and the vlc instances are nicely operating.

when i get to code this standalone file, i get all those errors.

please help me out compiling the code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group