Results 1 to 6 of 6

Thread: GStreamer, Qt4, QDevelop and C++

  1. #1
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default GStreamer, Qt4, QDevelop and C++

    Hello to all!
    I am new here. At the time, I am trying to make a window application on Linux, on QDevelop, using gui's created on Qt4. This app will use gstreamer to record and play avi's.

    I have some questions, because i am stuck! If anyone can help...

    1. Is there any good sample, tutorial on how to use gstreamer on a c++ application (sinks, elements), just to record and play, apart from gst doc? I haven't found anywhere something to explain how to simply click a button on a Qt app and play a video using gstreamer.

    2. How exactly can I view a list of strings in a table widget in a window and then choose an entry and get a value from it?

    3. Where should I create an object in QDevelop, so as to use this one object in the entire application?
    In simple words, I have to do sth like this RecorderComm rm = new RecorderComm(ip,port), and then, on the whole application, in all of its window, i will have to use functions of RecorderComm (rm.func1, and so on..)

    As you may have understood, my app will connect to a server to get the video to be played.

    Thank you in advance!

    I am a computer engineering student from Greece, who just got to know gstreamer, Qt4 and QDevelop!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GStreamer, Qt4, QDevelop and C++

    1. Playing video is easy using Phonon, recording can't be done this way, unfortunately...

    2. QListWidget or QListView and QStringListModel.

    3. You should create the object in your application, not in QDevelop Seriously, you have two choices - either a global variable or a singleton class. I'm sure you can google up these terms if you don't know them.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: GStreamer, Qt4, QDevelop and C++

    Thanks a lot for your advice!

    I finally used QTable-because i need to show there elements that come from a database with multiple fiellds- and it seems to work well.

    About Phonon, I have read about, but I'd rather use just plain gstreamer-that's the specs.

    I will try to use your advice about singleton class.

  4. #4
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: GStreamer, Qt4, QDevelop and C++

    Going on with the applications, I have the following problem:

    I am trying to make pipelines, so as to record and playback video with sound.
    How exactly can I find the "properties needed to pass to the pipeline to make it work(eg the sound source etc)

    I was given a sample code to do this, I have tried to make changes and adapt it to my machine, but nothing...Any ideas? Is there any way to find all these options somewhere?

    This is the code for creating three pipelines:


    Qt Code:
    1. const char* PLAYBACK =
    2. "filesrc location=foo.avi !"
    3. "avidemux name=demx ! ffdec_mpeg2video ! queue !"
    4. "xvimagesink name=x11w demx. ! queue ! ffdec_mp3 ! alsasink";
    5.  
    6. const char* RECORD = "alsasrc device=plughw:1,0 ! tee name=sndsrc !"
    7. "queue name=sndqueue max-size-buffers=100 ! audiorate !"
    8. " audio/x-raw-int,width=8,rate=16000 ! audioconvert ! ffenc_mp2 ! "
    9. "mx. v4lsrc typefind=true ! tee name=vidsrc ! queue name=vidqueue !"
    10. " videorate ! video/x-raw-yuv,framerate=25/1,width=640,height=480 !"
    11. " ffenc_mpeg2video ! avimux name=mx ! filesink location=foo.avi sndsrc. "
    12. "! queue ! alsasink vidsrc.! queue ! xvimagesink name=x11w";
    13.  
    14. const char* VIEW = "alsasrc device=plughw:1,0 ! "
    15. "queue name=sndqueue max-size-buffers=100 ! audiorate !"
    16. " audio/x-raw-int,width=8,rate=16000 ! alsasink v4lsrc typefind=true"
    17. " ! queue name=vidqueue ! videorate !"
    18. " video/x-raw-yuv,framerate=25/1,width=640,height=480 ! "
    19. "queue ! xvimagesink name=x11w";
    20.  
    21. //code
    22. //code
    23. //code
    24.  
    25. void GstFrame::create_pipeline()
    26. {
    27. if(pipeline) destroy_pipeline();
    28.  
    29. GError *err=0;
    30. pipeline = gst_parse_launch(pipmode,&err);
    31.  
    32. if (err != NULL) {
    33. /* Report error to user, and free error */
    34. cerr << "Unable to create pipeline: " << err->message << endl;
    35. return;
    36. } else {
    37. assert(pipeline!=0);
    38. }
    39. xvimagesink = gst_bin_get_by_name(GST_BIN(pipeline), "x11w");
    40. gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvimagesink), gstframe->winId());
    41.  
    42. bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
    43. bus_poll_timer->start(50);
    44.  
    45. pipeline_state = GST_STATE_NULL;
    46. set_eos(false);
    47. }
    To copy to clipboard, switch view to plain text mode 
    When I come to run this code, i get pipeline=0, and assert fails.
    no element alsasrc found


    sorry if the post is misplaced, or it is a trivial question, but I have never programmed that stuff before...
    thanks!
    Last edited by wysota; 28th April 2009 at 20:45. Reason: missing [code] tags

  5. #5
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: GStreamer, Qt4, QDevelop and C++

    Another question please, thanks in advance!

    How can I get an entire row from a TableWidget, by just clicking on it?

    When I click on a row, I need the data inside to be returned so as to pick what I want...

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: GStreamer, Qt4, QDevelop and C++

    Quote Originally Posted by midiangr View Post
    How can I get an entire row from a TableWidget, by just clicking on it?

    When I click on a row, I need the data inside to be returned so as to pick what I want...
    What did you already try?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QDevelop - global variables & help
    By impeteperry in forum Qt-based Software
    Replies: 2
    Last Post: 10th June 2011, 00:28
  2. Code completion for a Qwidget at Qt4 in QDevelop 4.3.1
    By sipklaus in forum Qt-based Software
    Replies: 3
    Last Post: 9th August 2010, 10:46
  3. Steps to configure Ctags with QDevelop
    By gmx234 in forum Qt-based Software
    Replies: 7
    Last Post: 11th June 2008, 23:41
  4. QDevelop auto-complete function and Qt4
    By degs2k4 in forum Qt-based Software
    Replies: 8
    Last Post: 6th May 2008, 19:43
  5. QDevelop - current development
    By ghorwin in forum Qt-based Software
    Replies: 2
    Last Post: 30th March 2007, 15:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.