Re: new to g_signal_connect

Hi James,

On Sat, Oct 11, 2008 at 3:39 PM, James Liggett <jrliggett cox net> wrote:
> Hi Charles,
> If I may ask, what exactly are you planning to do here? If all you want
> to do is write code to take a picture, that's pretty easy. All you have
> to do is connect your handler to the handoff signal when you're ready to
> snap it, and then disconnect as soon as you've done what you need to do
> with it.
> HTH,
> James

I think I did what you told me. I wrote a main for cheese-webcam.c like this:

main(int argc, char *argv[])
  CheeseWebcam* webcam;
  CheeseWebcamPrivate* priv;
  int k;

  gst_init(NULL, NULL);

  webcam = cheese_webcam_new (NULL, NULL);
  cheese_webcam_setup (webcam);
  priv = CHEESE_WEBCAM_GET_PRIVATE (webcam);
  cheese_webcam_init (webcam);

  /* I changed the mimetype because libpng has a better interface */
  cheese_webcam_take_photo (webcam, "image.png");

  while (k < 100) {
    g_signal_emit_by_name (priv->photo_sink, "handoff");

      * I have another program which periodically takes care of
      * the image.png. And this is just a test program.

  exit (0);

I discarded all other files because I don't need them. But when I run it,
I get a SIGSEGV. When I trace into the programme. This error is caused by
passing a NULL pointer to GstBuffer *buffer.

ps: Before I posted here I tried the function gst_base_sink_get_last_buffer,
I got the same result.

Thank you for your hint. But I'm in a new trouble. Any suggestions?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]