[gst-devel] Help for dshowaudiosrc

Julien Isorce julien.isorce at gmail.com
Thu Mar 19 13:55:01 CET 2009


Hi,

Try with the files in attachment.
I will investigate if you get the same error.

J.

Le 19 mars 2009 12:08, <cammille at polytech.unice.fr> a écrit :

> Hello,
> Si je ne me trompe pas vous êtes français. Alors ça sera beaucoup plus
> simple pour moi de vousparler en français.
>
> Voilà je suis allé sur cette page :
> http://bugzilla.gnome.org/attachment.cgi?id=126508&action=diff
>
>
> Et j'ai fait les modifications des fichiers gstdshowaudio.c et .h.
> J'ai ensuite créé les fichiers :
> - gstdshowaudiomixertrack.h
> - gstdshowaudiomixertrack.c
> - gstdshowaudiomixer.h
> - gstdshowaudiomixer.c
>
> Si je ne me trompe pas on en a besoin...
>
> Le problème est que lorsque je compile j'ai des erreurs du type :
> Erreur  3       error C2014: une commande de préprocesseur doit commencer
> comme
> premier espace autre que
> blanc
> c:\gstreamer-winbuild\gstreamer\gst-plugins-bad\sys\dshowsrcwrapper\gstdshowaudiomixer.h
>        164     libdshowsrcwrapper
>
> L'erreur est à cette ligne : interface_as_function ## _supported (Type
> *this, GType iface_type)
>
> Et donc à partir de là j'ai plein d'autres erreurs.
>
> Je ne comprends pas ce que je fais de mal.
> J'aurais voulu télécharger directement tes correctifs mais je n'ai pas pu.
>
> J'attends votre réponse, merci de m'aider.
>
>
> Cordialement,
>   Lorenzo Cammilleri
>
>

2009/3/18 Julien Isorce <julien.isorce at gmail.com>

> it's a bug in the original dshowaudiosrc,
>
> as you can see in around line 360 of
> http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/sys/dshowsrcwrapper/gstdshowaudiosrc.c
> there is no PROP_DEVICE_NAME case in the switch.
>
> static void
> gst_dshowaudiosrc_set_property (GObject * object, guint prop_id,
>     const GValue * value, GParamSpec * pspec)
> {
>   GstDshowAudioSrc *src = GST_DSHOWAUDIOSRC (object);
>
>   switch (prop_id) {
>     case PROP_DEVICE:
>     {
>       if (src->device) {
>         g_free (src->device);
>         src->device = NULL;
>       }
>       if (g_value_get_string (value)) {
>         src->device = g_strdup (g_value_get_string (value));
>
>       }
>       break;
>     }
>     default:
>       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
>       break;
>   }
> }
>
> The fix is in the patch.
>
>
> 2009/3/18 <cammille at polytech.unice.fr>
>
>> In the sound properties on WIndows, my device to capture the sound is
>> named : "Realtek HD Audio Input"
>>
>> So I try :
>> gst-launch-0.10.exe dshowaudiosrc device-name="Realtek HD Audio Input" !
>> audioconvert ! vorbisenc ! oggmux ! filesink location=bar.ogg
>>
>> But I have an error which is :
>> ** (gst-launch-0.10:77172): WARNING **:
>> ..\..\sys\dshowsrcwrapper\gstdshowaudios
>> rc.c:378: invalid property id 2 for "device-name" of type `GParamString'
>> in `Gst
>> DshowAudioSrc'
>>
>>
>>
>> > 2009/3/18 <cammille at polytech.unice.fr>
>> >
>> >> I would prefer to not recompile dshowaudiosrc if it's possible.
>> >> My microphone is not muted. So I don't understand why it didn't work.
>> >> With
>> >> the windows magnetophone I can register my voice. Very strange...
>> >
>> >
>> > Maybe how are not using the device you are excepting to use.  In panel
>> > configuration, sound, you can see if you have several audio devices. If
>> > yes,
>> > you have to set device name on dshowaudiosrc. (check the volume too)
>> >
>> >
>> >> I don't find any information about property probe.. so I don't know how
>> >> to
>> >> use it.
>> >
>> >
>> > gst doc.
>> >
>> >
>> >>
>> >> > Hi,
>> >> >
>> >> > 2 solutions.
>> >> >
>> >> > ****The first one (user) is to click on volume icone from task bar
>> >> then
>> >> > Options->properties then select "Enregistrement" ("Recording") then
>> >> select
>> >> > microphone then OK then unmute microphone.
>> >> >
>> >> > ****The second solution (using code), is to recompile dshowaudiosrc
>> >> using
>> >> > this patch:
>> >> > http://bugzilla.gnome.org/show_bug.cgi?id=517203  (just see the last
>> >> post)
>> >> >
>> >> > Then the following code could be used to list, select and configure
>> >> the
>> >> > input channel of your choise (S/PDIF, lineIn, Mic etc..)
>> >> >
>> >> > ----------------------------- list audio input
>> >> ------------------------
>> >> > vector<string> listAudioInputs(const string audioDeviceName)
>> >> > GstElement* audiodevicesrc = create_element("dshowaudiosrc",
>> >> > "audiodevicesrc");
>> >> >  g_object_set(G_OBJECT(audiodevicesrc), "device-name",
>> >> > audioDeviceName.c_str(), NULL);
>> >> >
>> >> >  GstPad* pad = gst_element_get_static_pad  (audiodevicesrc, "src");
>> >> >  gst_pad_get_caps (pad);
>> >> >  if (pad)
>> >> >      gst_object_unref(pad);
>> >> >
>> >> >  vector<string> l_inputs;
>> >> >  GstMixer *mixer = GST_MIXER (audiodevicesrc);
>> >> > const GList* list = gst_mixer_list_tracks (mixer);
>> >> >
>> >> >  for (const GList* item = list; item != NULL; item = item->next)
>> >> > {
>> >> >     GstMixerTrack *track = (GstMixerTrack*)item->data;
>> >> >      l_inputs.push_back(string(track->label));
>> >> > }
>> >> >
>> >> >  if (audiodevicesrc)
>> >> > {
>> >> >      gst_element_set_state (audiodevicesrc, GST_STATE_NULL);
>> >> >      gst_object_unref(GST_OBJECT (audiodevicesrc));
>> >> > }
>> >> >
>> >> > return l_inputs;
>> >> > }
>> >> >
>> >>
>> ------------------------------------------------------------------------------------------------------
>> >> >
>> >> > ---------------------------- select record input and set volume
>> >> > -------------------------------------
>> >> > void setAudioInput(const string audioInput, int volumePercentOfMax)
>> >> > {
>> >> >   GstMixer *mixer = GST_MIXER (audiodevicesrc);
>> >> >   GstMixerTrack *track = NULL;
>> >> >   const GList* list = gst_mixer_list_tracks (mixer);
>> >> >   for (const GList* item = list; item != NULL; item = item->next)
>> >> >    {
>> >> >       GstMixerTrack *track_next = (GstMixerTrack*)item->data;
>> >> >       if (audioInput == std::string(track_next->label))
>> >> >            track = track_next;
>> >> >         else
>> >> >            //mute other audio inputs
>> >> >            gst_mixer_set_mute(mixer, track_next, TRUE);
>> >> >    }
>> >> > if (track)
>> >> > {
>> >> >     vector<gint> volumes(m_audioNbChannels, (gint)(volumePercentOfMax
>> >> *
>> >> > track->max_volume / 100.0));
>> >> >      gst_mixer_set_record (mixer, track, TRUE);
>> >> >      gst_mixer_set_volume (mixer, track, &volumes[0]);
>> >> >
>> >> >   }
>> >> > }
>> >> >
>> >> >
>> >>
>> ------------------------------------------------------------------------------------------------------
>> >> >
>> >> > They are some bad things in this code but the idea is there.
>> >> >
>> >> > You can also use property probe on dshowaudiosrc to list all the
>> audio
>> >> > device names installed on your system.
>> >> >
>> >> > J.
>> >> >
>> >> >
>> >> > 2009/3/18 <cammille at polytech.unice.fr>
>> >> >
>> >> >> Hello,
>> >> >>
>> >> >> I'm trying to use dshowaudiosrc on Windows but I have some problems.
>> >> >>
>> >> >> For example, I try :
>> >> >>
>> >> >> gst-launch-0.10.exe dshowaudiosrc ! audioconvert ! vorbisenc !
>> oggmux
>> >> !
>> >> >> filesink location=foo.ogg
>> >> >>
>> >> >> And hen I talk in my micro the file foo.ogg is empty.
>> >> >> I already verified if my micro functions correctly. It does.
>> >> >>
>> >> >> If I try :
>> >> >> gst-launch-0.10.exe audiotestsrc ! audioconvert ! vorbisenc ! oggmux
>> >> !
>> >> >> filesink location=foo.ogg it works !
>> >> >>
>> >> >>
>> >> >> Where is the problem ?
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
>> >> are
>> >> >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly
>> >> and
>> >> >> easily build your RIAs with Flex Builder, the Eclipse(TM)based
>> >> >> development
>> >> >> software that enables intelligent coding and step-through debugging.
>> >> >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> >> >> _______________________________________________
>> >> >> gstreamer-devel mailing list
>> >> >> gstreamer-devel at lists.sourceforge.net
>> >> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>> >> >>
>> >> >
>> >>
>> ------------------------------------------------------------------------------
>> >> > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)
>> >> are
>> >> > powering Web 2.0 with engaging, cross-platform capabilities. Quickly
>> >> and
>> >> > easily build your RIAs with Flex Builder, the Eclipse(TM)based
>> >> development
>> >> > software that enables intelligent coding and step-through debugging.
>> >> > Download the free 60 day trial.
>> >> >
>> >>
>> http://p.sf.net/sfu/www-adobe-com_______________________________________________
>> >> > gstreamer-devel mailing list
>> >> > gstreamer-devel at lists.sourceforge.net
>> >> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>> >> >
>> >>
>> >>
>> >>
>> >>
>> >>
>> ------------------------------------------------------------------------------
>> >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly
>> and
>> >> easily build your RIAs with Flex Builder, the Eclipse(TM)based
>> >> development
>> >> software that enables intelligent coding and step-through debugging.
>> >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> >> _______________________________________________
>> >> gstreamer-devel mailing list
>> >> gstreamer-devel at lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>> >>
>> >
>> ------------------------------------------------------------------------------
>> > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> > easily build your RIAs with Flex Builder, the Eclipse(TM)based
>> development
>> > software that enables intelligent coding and step-through debugging.
>> > Download the free 60 day trial.
>> >
>> http://p.sf.net/sfu/www-adobe-com_______________________________________________
>> > gstreamer-devel mailing list
>> > gstreamer-devel at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>> >
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
>> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
>> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
>> software that enables intelligent coding and step-through debugging.
>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090319/7b19ac20/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dshowsrcwrapper.zip
Type: application/zip
Size: 48242 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090319/7b19ac20/attachment.zip>


More information about the gstreamer-devel mailing list