~ubuntu-branches/ubuntu/saucy/phonon-backend-gstreamer/saucy-proposed

« back to all changes in this revision

Viewing changes to gstreamer/devicemanager.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2011-04-15 14:43:30 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110415144330-7uif3319lxdu4ltt
Tags: 4:4.7.0really4.5.0-0ubuntu2
* New upstream release
* Add kubuntu_02_install_codec.diff to fix codec install

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include "glrenderer.h"
24
24
#include "widgetrenderer.h"
25
25
#include "x11renderer.h"
26
 
#include "artssink.h"
27
26
#include <phonon/pulsesupport.h>
28
27
 
29
28
#ifdef USE_ALSASINK2
43
42
{
44
43
namespace Gstreamer
45
44
{
46
 
    
 
45
 
47
46
VideoCaptureDevice::VideoCaptureDevice(DeviceManager *manager, const QByteArray &gstId)
48
47
        : gstId(gstId)
49
48
{
198
197
* Returns a GstElement with a valid audio sink
199
198
* based on the current value of PHONON_GSTREAMER_DRIVER
200
199
*
201
 
* Allowed values are auto (default), alsa, oss, arts and ess
 
200
* Allowed values are auto (default), alsa, oss and ess
202
201
* does not exist
203
202
*
204
203
* If no real sound sink is available a fakesink will be returned
266
265
            }
267
266
        } else if (m_audioSink == "fake") {
268
267
            //do nothing as a fakesink will be created by default
269
 
        } else if (m_audioSink == "artssink") {
270
 
            sink = GST_ELEMENT(g_object_new(arts_sink_get_type(), NULL));
271
268
        } else if (!m_audioSink.isEmpty()) { //Use a custom sink
272
269
            sink = gst_element_factory_make (m_audioSink, NULL);
273
270
            if (canOpenDevice(sink))
397
394
void DeviceManager::updateDeviceList()
398
395
{
399
396
    QList<QByteArray> list;
400
 
    
 
397
 
401
398
    GstElement *captureDevice = gst_element_factory_make("v4l2src", NULL);
402
399
    if (captureDevice) {
403
400
        QList<QByteArray> list;
412
409
        }
413
410
        gst_element_set_state (captureDevice, GST_STATE_NULL);
414
411
        gst_object_unref (captureDevice);
415
 
        
 
412
 
416
413
        if (list.size() < m_videoCaptureDeviceList.size()) {
417
414
            //a device was removed
418
415
            for (int i = m_videoCaptureDeviceList.size() -1 ; i >= 0 ; --i) {
435
432
    }
436
433
    //fetch list of current devices
437
434
    GstElement *audioSink= createAudioSink();
438
 
    
 
435
 
439
436
    if (audioSink) {
440
437
        if (!PulseSupport::getInstance()->isActive()) {
441
438
            // If we're using pulse, the PulseSupport class takes care of things for us.