Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Linking Element to Bin #152

Open
Open

Description

@lunderhage

I have a problem linking a source to a Bin:

Works:

Bin bin = Bin.launch("filesrc location=/tmp/sound.au ! queue ! audio/x-raw-int,rate=44100,channels=1,width=16,depth=16,signed=true,endianness=4321 ! audioconvert ! lame ! filesink location=/tmp/sound.mp3", true);
Pipeline pipe = new Pipeline();
pipe.addMany(bin);

...

Does not work:

Element source = ElementFactory.make("filesrc", "filesrc0");
source.set("location", `"/tmp/sound.au");`
Bin bin = Bin.launch("queue ! audio/x-raw-int,rate=44100,channels=1,width=16,depth=16,signed=true,endianness=4321 ! audioconvert ! lame ! filesink location=/tmp/sound.mp3", false);
Pipeline pipe = new Pipeline();
source.link(bin);
pipe.addMany(source, bin);

...

What is the difference between the filesrc inside the bin and my external one that I link to the bin?

Activity

  1. neilcsmith-net commented on Oct 19, 2016

    @neilcsmith-net
    Member

    If you pass false to Bin.launch() you need to manually create a ghost pad on the queue in order to link the bin to anything else.

    Not sure why you're using Bin at all for this? You could probably get away with Pipeline.launch()?

    If you use filesrc name=filesrc you can then retrieve the element from the bin or pipeline (get element by name) to set the location. That's my personal preference anyway.

  2. lunderhage commented on Oct 19, 2016

    @lunderhage
    Author

    filesrc/filesink is just for testing. My intent is to use AppSrc and AppSink with buffers I can write and read from within java. The idea is to encode mp3 on the fly from a microphone/line-in jack.

    The reason for using a Bin is because it does not work to set the Caps on the queue element, but for some reason it works within the Bin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions