[gst-devel] WARNING **: couldn't set requested OSS parameters, enjoy the noise :)

Jason Bodnar jason at shakabuku.org
Wed May 28 10:25:03 CEST 2003


I'm trying to write a media player with gstreamer and SDL. I've written a
simple test program and when I run it I get the following output:

INFO (28399: 0) Initializing GStreamer Core Library version 0.6.1 
INFO (28399: 0) CPU features: (0c040882) MMX SSE 
INFO (28399: 0) registry: loaded user_registry in 0.000205 seconds
          (/home/jbodnar/.gstreamer/registry.xml)
INFO (28399: 0) registry: loaded global_registry in 0.218127 seconds
          (/var/cache/gstreamer-0.6/registry.xml)
Mouse button released: x=339, y=245

** (process:28401): WARNING **: couldn't set requested OSS parameters, enjoy
the noise :)


And I don't even hear noise.

Any ideas? Here's the code:

#include "SDL.h"
#include "SDL_image.h"
#include <gst/gst.h>
#include <stdio.h>

int clean_exit() {
 SDL_Quit();
 return -1;
}

void eos(GstElement *src, gpointer data) {
        
 GstThread *thread = GST_THREAD(data);
 gst_element_set_state(GST_ELEMENT(thread), GST_STATE_NULL);
 gst_main_quit();

}

int main(int argc, char **argv) {

 SDL_Surface *screen, *button;
 SDL_Rect dest;
 SDL_Event event;

 GstElement *filesrc, *decoder, *audiosink;
 GstElement *thread;

 if((SDL_Init(SDL_INIT_VIDEO) == -1)) {
  fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError());
  exit(-1);
 }

 gst_init(&argc, &argv);

 atexit(clean_exit);

 screen = SDL_SetVideoMode(640, 480, 24, SDL_SWSURFACE);
 if (screen == NULL) {
  fprintf(stderr, "Couldn't set 640x480x24 video mode: %s\n", SDL_GetError());
  exit(1);
 }

 button = IMG_Load("play_active.png");
 if (button == NULL) {
  fprintf(stderr, "%s\n", SDL_GetError());
 }
        
 dest.x = 320;
 dest.y = 240;
 dest.w = 0;
 dest.h = 0;
        
 SDL_BlitSurface(button, NULL, screen, &dest);
 SDL_UpdateRect(screen, dest.x, dest.y, dest.w, dest.h);

 // Create audio pipeline
 thread = gst_thread_new("thread");
 filesrc = gst_element_factory_make("filesrc", "disk_source");
 g_signal_connect (G_OBJECT(filesrc), "eos", G_CALLBACK(eos), thread);
 decoder = gst_element_factory_make("mad", "decoder");
 audiosink = gst_element_factory_make("osssink", "play_audio");
 gst_bin_add_many(GST_BIN(thread), filesrc, decoder, audiosink, NULL);
 gst_element_link_many(filesrc, decoder, audiosink, NULL);

 while (SDL_WaitEvent(&event)) {

  switch (event.type) {
  case SDL_MOUSEBUTTONUP:
   printf("Mouse button released: x=%d, y=%d\n", event.button.x, event.button.y);
   if ((event.button.x > 320) &&
       (event.button.x < 320 + button->w) &&
       (event.button.y > 240) &&
       (event.button.y < 240 + button->h)) {
                                
    g_object_set(G_OBJECT(filesrc), "location", argv[1], NULL);
    gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PLAYING);

   }
   break;

  case SDL_QUIT:
   exit(0);
   break;
  }
 }
        
 exit(0);

}


--
Jason Bodnar
jason at shakabuku.org
http://www.shakabuku.org

"You want free speech? Let's see you acknowledge a man whose words make
your blood boil who is standing center stage advocating at the top of
his lungs that which you would spend a lifetime opposing at the top of
yours." -- President Andrew Shephard, "The American President"





More information about the gstreamer-devel mailing list