[gst-devel] directsound sink

John Janecek nopa90 at gmail.com
Sat Dec 24 18:49:03 CET 2005


Thanx :)
The gettype override is because when i first started making plugs with
gob (like 3 weeks ago) gob did not make the correct gettype. (might be
user error :) ). So I just wacked it with a hammer till it worked :).

I only started working with gstreamer and gobjects like 3-4 weeks ago.
The "destroywith" methods are the way to go :).

Also there should be a way to deal with failure to initialize device etc.
I think that should be done in
override (Gst:Element) GstStateChangeReturn
change_state(GstElement *element, GstStateChange transition)
but I am not 100% sure.

And yes variable probably should be private :). Ignorance on my behalf :)

Anyway it is a basis for making a dsound sink that is compiler
independant, and does not require linking against the MS libs. I just
posted the code since someone mentioned they needed directsound and
directx sinks for 0.10.

Anyway thanx :)

On 12/24/05, Ikke <eikke at eikke.com> wrote:
> On Sat, 2005-12-24 at 15:32 +0800, John Janecek wrote:
> > Here is a direct sound sink i make for gstreamer0.10
>
> Cool, gob :)
>
> In the gob file, you might want to use something like
>         override (Gst:Audio:Sink) gboolean close(GstAudioSink *sink (check null
> type))
> where appropriate, to get a certain level of type safety and input
> (null) validation.
>
> Is there any reason all your member variables are declared protected,
> and not private (just asking, you might have a good reason :-))
>
> You override "finalize" to free some members. You could get the same
> effect without implementing a finalize method yourself, but by using
> something like
>         protected LPDIRECTSOUND lpDS = NULL
>                 destroywith IDirectSound_Release;
> The NULL check will be generated automagicly.
>
> As you define PRIV and _PRIV in a header, this header file should only
> be #include's in "privateheader", not in "alltop" (IMHO). You might as
> well use
>         %ph{
>                 #define PRIV(x) self->_priv->x
>                 #define _PRIV self->_priv
>         %}
>
> Is there any reason you define a get_type function manually? Gob should
> do that for you.
>
> I don't think you should include windows.h, dsound.h and alike in
> alltop, as the types and functions defined in these headers are only
> used internally. The headers should be included in "privateheader".
>
>
> Just trying to be helpful...
>
> Ikke
> http://www.eikke.com
>
>




More information about the gstreamer-devel mailing list