~ubuntu-branches/ubuntu/quantal/gst-plugins-bad0.10/quantal-proposed

« back to all changes in this revision

Viewing changes to sys/shm/gstshmsink.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-07-19 14:32:43 UTC
  • mfrom: (18.4.21 sid)
  • Revision ID: james.westby@ubuntu.com-20110719143243-p7pnkh45akfp0ihk
Tags: 0.10.22-2ubuntu1
* Rebased on debian unstable, remaining changes:
  - debian/gstreamer-plugins-bad.install
    * don't include dtmf, liveadder, rtpmux, autoconvert and shm, we include 
      them in -good

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
#define DEFAULT_SIZE ( 256 * 1024 )
58
58
#define DEFAULT_WAIT_FOR_CONNECTION (TRUE)
59
 
#define DEFAULT_PERMS (S_IRWXU | S_IRWXG)
 
59
/* Default is user read/write, group read */
 
60
#define DEFAULT_PERMS ( S_IRUSR | S_IWUSR | S_IRGRP )
60
61
 
61
62
 
62
63
GST_DEBUG_CATEGORY_STATIC (shmsink_debug);
298
299
    return FALSE;
299
300
  }
300
301
 
 
302
  sp_set_data (self->pipe, self);
301
303
  g_free (self->socket_path);
302
304
  self->socket_path = g_strdup (sp_writer_get_path (self->pipe));
303
305
 
411
413
static void
412
414
gst_shm_sink_free_buffer (gpointer data)
413
415
{
 
416
  ShmPipe *pipe;
414
417
  ShmBlock *block = data;
 
418
  GstShmSink *self;
 
419
 
 
420
  pipe = sp_writer_block_get_pipe (block);
 
421
  self = sp_get_data (pipe);
 
422
 
 
423
  GST_OBJECT_LOCK (self);
415
424
  sp_writer_free_block (block);
 
425
  GST_OBJECT_UNLOCK (self);
 
426
  g_object_unref (self);
416
427
}
417
428
 
418
429
static GstFlowReturn
426
437
 
427
438
  GST_OBJECT_LOCK (self);
428
439
  block = sp_writer_alloc_block (self->pipe, size);
429
 
  if (block)
 
440
  if (block) {
430
441
    buf = sp_writer_block_get_buf (block);
 
442
    g_object_ref (self);
 
443
  }
431
444
  GST_OBJECT_UNLOCK (self);
432
445
 
433
446
  if (block) {
503
516
      self->clients = g_list_prepend (self->clients, gclient);
504
517
      g_signal_emit (self, signals[SIGNAL_CLIENT_CONNECTED], 0,
505
518
          gclient->pollfd.fd);
 
519
      /* we need to call gst_poll_wait before calling gst_poll_* status
 
520
         functions on that new descriptor, so restart the loop, so _wait
 
521
         will have been called on all elements of self->poll, whether
 
522
         they have just been added or not. */
 
523
      continue;
506
524
    }
507
525
 
508
526
  again: