~sipe-collab/sipe-collab/gstreamer-plugins-base

« back to all changes in this revision

Viewing changes to gst/playback/gstplaybin2.c

  • Committer: Sebastian Dröge
  • Date: 2014-04-19 13:47:47 UTC
  • mfrom: (1.1.23)
  • Revision ID: git-v1:d06393f82dba0d5f13ec2e66275d75cf8178fe5c
Merge tag 'upstream/1.2.4'

Upstream version 1.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
3009
3009
 
3010
3010
  playbin = group->playbin;
3011
3011
 
3012
 
  caps = gst_pad_query_caps (pad, NULL);
 
3012
  caps = gst_pad_get_current_caps (pad);
 
3013
  if (!caps)
 
3014
    caps = gst_pad_query_caps (pad, NULL);
3013
3015
  s = gst_caps_get_structure (caps, 0);
3014
3016
  name = gst_structure_get_name (s);
3015
3017
 
3284
3286
  if (!(peer = g_object_get_data (G_OBJECT (pad), "playbin.sinkpad")))
3285
3287
    goto not_linked;
3286
3288
 
 
3289
  /* unlink the pad now (can fail, the pad is unlinked before it's removed) */
 
3290
  gst_pad_unlink (pad, peer);
 
3291
 
 
3292
  /* get combiner */
 
3293
  combiner = GST_ELEMENT_CAST (gst_pad_get_parent (peer));
 
3294
  g_assert (combiner != NULL);
 
3295
 
3287
3296
  if ((combine = g_object_get_data (G_OBJECT (peer), "playbin.combine"))) {
3288
3297
    if (combine->has_tags) {
3289
3298
      gulong notify_tags_handler;
3328
3337
    }
3329
3338
  }
3330
3339
 
3331
 
  /* unlink the pad now (can fail, the pad is unlinked before it's removed) */
3332
 
  gst_pad_unlink (pad, peer);
3333
 
 
3334
 
  /* get combiner, this can be NULL when the element is removing the pads
3335
 
   * because it's being disposed. */
3336
 
  combiner = GST_ELEMENT_CAST (gst_pad_get_parent (peer));
3337
 
  if (!combiner) {
3338
 
    gst_object_unref (peer);
3339
 
    goto no_combiner;
3340
 
  }
3341
 
 
3342
3340
  /* release the pad to the combiner, this will make the combiner choose a new
3343
3341
   * pad. */
3344
3342
  gst_element_release_request_pad (combiner, peer);
3359
3357
    GST_DEBUG_OBJECT (playbin, "pad not linked");
3360
3358
    goto exit;
3361
3359
  }
3362
 
no_combiner:
3363
 
  {
3364
 
    GST_DEBUG_OBJECT (playbin, "combiner not found");
3365
 
    goto exit;
3366
 
  }
3367
3360
}
3368
3361
 
3369
3362
/* we get called when all pads are available and we must connect the sinks to
3839
3832
{
3840
3833
  GList *dec_list = NULL, *tmp;
3841
3834
  GList *ave_list = NULL;
 
3835
  GList *ave_free_list = NULL;
3842
3836
  GstAVElement *ave, *best_ave;
3843
3837
 
3844
3838
  g_return_val_if_fail (factory_list != NULL, NULL);
3848
3842
    GstElementFactory *factory = (GstElementFactory *) tmp->data;
3849
3843
 
3850
3844
    /* if there are parsers or sink elements, add them first */
3851
 
    if (!gst_element_factory_list_is_type (factory,
3852
 
            GST_ELEMENT_FACTORY_TYPE_DECODER)) {
3853
 
      dec_list = g_list_prepend (dec_list, factory);
 
3845
    if (gst_element_factory_list_is_type (factory,
 
3846
            GST_ELEMENT_FACTORY_TYPE_PARSER) ||
 
3847
        gst_element_factory_list_is_type (factory,
 
3848
            GST_ELEMENT_FACTORY_TYPE_SINK)) {
 
3849
      dec_list = g_list_prepend (dec_list, gst_object_ref (factory));
3854
3850
    } else {
3855
3851
      GSequenceIter *seq_iter;
3856
3852
 
3865
3861
        /* There's at least raw */
3866
3862
        ave->n_comm_cf = 1;
3867
3863
 
3868
 
        dec_list = g_list_prepend (dec_list, factory);
 
3864
        ave_list = g_list_prepend (ave_list, ave);
 
3865
 
 
3866
        /* We need to free these later */
 
3867
        ave_free_list = g_list_prepend (ave_free_list, ave);
3869
3868
        continue;
3870
3869
      }
3871
3870
 
3899
3898
  ave_list = g_list_sort (ave_list, (GCompareFunc) avelement_compare);
3900
3899
  for (tmp = ave_list; tmp; tmp = tmp->next) {
3901
3900
    ave = (GstAVElement *) tmp->data;
3902
 
    dec_list = g_list_prepend (dec_list, ave->dec);
 
3901
    dec_list = g_list_prepend (dec_list, gst_object_ref (ave->dec));
3903
3902
  }
3904
3903
  g_list_free (ave_list);
 
3904
  gst_plugin_feature_list_free (factory_list);
 
3905
 
 
3906
  for (tmp = ave_free_list; tmp; tmp = tmp->next)
 
3907
    g_slice_free (GstAVElement, tmp->data);
 
3908
  g_list_free (ave_free_list);
3905
3909
 
3906
3910
  dec_list = g_list_reverse (dec_list);
3907
3911
 
5523
5527
          l = l->next;
5524
5528
        }
5525
5529
      }
 
5530
 
 
5531
      if (playbin->source) {
 
5532
        gst_object_unref (playbin->source);
 
5533
        playbin->source = NULL;
 
5534
      }
 
5535
 
5526
5536
      GST_OBJECT_UNLOCK (playbin);
5527
5537
      break;
5528
5538
    }