anubhav94 / gstreamer-java

Automatically exported from code.google.com/p/gstreamer-java
0 stars 0 forks source link

AppSrc missing "name" constructor #114

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The AppSrc element is missing the "name" constructor found in other elements. 
Proposed implementation:

public AppSrc(String name) {
  this(makeRawElement(GST_NAME, name));
}

Original issue reported on code.google.com by cow...@bbs.darktech.org on 20 Sep 2012 at 8:12

GoogleCodeExporter commented 9 years ago
i don't get it. you can't create an appsrc just cast an existing one.

Original comment by lfar...@lfarkas.org on 26 Nov 2012 at 12:12

GoogleCodeExporter commented 9 years ago
What do you mean just cast an existing one?

Original comment by cow...@bbs.darktech.org on 26 Nov 2012 at 2:17

GoogleCodeExporter commented 9 years ago
i mean if an appsrc created by the native elements and than it's propagated up 
to the java. then the new element can be automatically converted to AppSrc but 
it's not possible to create an AppSrc from java. so there is no need for such 
constructor. or am i fail?

Original comment by lfar...@lfarkas.org on 26 Nov 2012 at 2:34

GoogleCodeExporter commented 9 years ago
Yeah you could make it using ElementFactory... and then cast it to AppSrc... 
but isn't that what AppSrc wrapper is for? Or any other gstreamer-java element 
wrapper? 

If you add OP's ctor to the AppSrc code, you can make an AppSrc instance like 
so: 

AppSrc as = new AppSrc("app source"); 

Which under the hood does what you said... And you can use it, and it works... 
created from Java.

Original comment by cipirip...@gmail.com on 26 Nov 2012 at 3:46

GoogleCodeExporter commented 9 years ago
To clarify,

Cipiripper would like to subclass AppSrc in order to add convenience methods. 
We're asking you to either allow sub-classing by adding a protected constructor 
or provide an interface (implemented by AppSrc) allowing us to add this 
functionality by composition.

Original comment by EKwe...@bbs.darktech.org on 26 Nov 2012 at 8:00

GoogleCodeExporter commented 9 years ago
is it ok? r582

Original comment by lfar...@lfarkas.org on 27 Nov 2012 at 11:39

GoogleCodeExporter commented 9 years ago
Yeah, that is it. :)

Original comment by cipirip...@gmail.com on 27 Nov 2012 at 2:38